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

Show grand total only of unique values

Hi,

I have below kind of data. I want to show grand total only of the uniquhe values per FN. Any help is appreciated. Thanks.

FNLocNoCount
151
2101
 581
Grand Total 2
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could try below measure

Measure 4 = IF(HASONEVALUE(t3[FN]), DISTINCTCOUNT(t3[FN]), CALCULATE(DISTINCTCOUNT(t3[LocNo]), t3[FN]<>BLANK()))

767.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

9 REPLIES 9
dax
Community Support
Community Support

Hi @Anonymous , 

You could try below measure

Measure 4 = IF(HASONEVALUE(t3[FN]), DISTINCTCOUNT(t3[FN]), CALCULATE(DISTINCTCOUNT(t3[LocNo]), t3[FN]<>BLANK()))

767.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Grand total should be displayed as 2 because the unique values by FN is 2. Generally, total is 3 but it should be displayed as 2 even if total is 3.

DataZoe
Employee
Employee

Hi @Anonymous, have you tried using the measure No Count = DISTINCTCOUNT(TableName[FN])? 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Ah I see! Have you tried No Count = DISTINCTCOUNTNOBLANK(TableName[FN])?

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

@DataZoe Thanks for your reply but sorry it didn't work. Only grand total should have distinct but at the subtotal level it shouldn't be. I tried with sumx but somehow I didn't succeed.

@Anonymous ,

Let me know is this your expected output?

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

thanks @Tahreem24 for your efforts but in measure1 there will be 1 1 1 in each row so total will be 3 ideally but it will show 2. Basically, I want that only grand total should be of unique values. 

Tahreem24
Super User
Super User

@Anonymous ,

Not exact getting your query. PLease share some more deets.

But if you want get the unique value so Use DISTINCT(TableName[ColumnName])

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
AllisonKennedy
Super User
Super User

Not sure what you mean by unique values? Can you provide more info on your raw data please?

You can add a filter for FN <>BLANK() or FN not null

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.