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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Total by different Dimension

Hi,

I have 2 below visuals, the first visual is giving the correct total = 51 for the measure 'Distinct Counts' and it has a filter which is on the second measure 'Total Counts'>1.

In the second visual I want to see it by state not Job Number, but it gives me wrong total = 2170 with the filter 'Total Counts'>1.

The DAX are as below:
Distinct Counts =
DISTINCTCOUNTNOBLANK( Tow[Job Number])

and

Total Counts = COUNTROWS( Tow)

I know I will need to use sumx with summrize, but I can't get it to work

 

Can you please help.

 

2021-03-30_16-03-30.png

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , For Distinct Count > 1

Try like

sumx(filter(Values( Tow[Job Number]) , [Distinct Counts] >1),[Distinct Counts])

 

distinct count can behave differently based on group by

View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

please try to write measure like below.

Measure = 

VAR _newtable = filter ( summarize (table, jobnumber column, "@totalcount", your total count measure) , [@totalcount] >1)
RETURN

sumx (_newtable, [@totalcount])

 

If it is Ok with you, please share your sample pbix file, then I can try to come up with a

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

more accurate measure.

 

Thank you.

 

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

4 REPLIES 4
Anonymous
Not applicable

Thank you so much @amitchandak , it worked.

Appreicate it.

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

please try to write measure like below.

Measure = 

VAR _newtable = filter ( summarize (table, jobnumber column, "@totalcount", your total count measure) , [@totalcount] >1)
RETURN

sumx (_newtable, [@totalcount])

 

If it is Ok with you, please share your sample pbix file, then I can try to come up with a

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

more accurate measure.

 

Thank you.

 

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


Anonymous
Not applicable

Thanks @Jihwan_Kim , your solution also worked. great.

amitchandak
Super User
Super User

@Anonymous , For Distinct Count > 1

Try like

sumx(filter(Values( Tow[Job Number]) , [Distinct Counts] >1),[Distinct Counts])

 

distinct count can behave differently based on group by

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors