Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Balaraju
Helper II
Helper II

Need help in All, Allselected, AllExcept function

HI All,

I have data for distinct count of customer based on monthly level, my requirement is in bar chart I want to show the distinct count of cutomer by monthly level and quarter level.

So which dax I want to use for quarter level.

 

Balaraju_3-1671513029752.png

 

 

The expected output is in below screenshot:

Balaraju_2-1671512656430.png

 

Sample Data:

Year Month NumberDistinct count of customer by month level
2022-04513
2022-05549
2022-06319
2022-07481
2022-08451
2022-09351
2022-10543
2022-11508
2022-12355

 

Thanks,

Balaraju.

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1671514954214.png

 

 

quarterly customer count distinct: = 
CALCULATE (
    MAX(Data[Customer count]),
    ALL ( Data[Month end], Data[Year Month Number] ),
    VALUES ( Data[End of Quarter] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1671514954214.png

 

 

quarterly customer count distinct: = 
CALCULATE (
    MAX(Data[Customer count]),
    ALL ( Data[Month end], Data[Year Month Number] ),
    VALUES ( Data[End of Quarter] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


MahyarTF
Memorable Member
Memorable Member

Hi,

You need to define the type of the 'Year Month Number' column as a date and Format as a 'yyyy-mm', then develop the Line and Clustered Column chart and put the 'Year Month Number' in X-axis and 'Distinct of Month' in Y-axis and 'Distinct of Quarter' in Line Y-axis.

an also adjust the legend place and change the color for bar and line chart :

MahyarTF_0-1671514941314.png

Thanks for Kudos and please mark it as a solution if it helps you.

Mahyartf

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.