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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sflynn
Helper I
Helper I

DAX Measure Category Total per row

I am trying to display the total count by category for each line item within the category based on the slicer selections. The problem I am having is if I use a count ignoring the field used in the slicer it takes the total regardless of the slicer selection. Conversly, if I use a count without ignoring the slicer fields the totals show based on the different fields in the slicer and now the total for the category.
In the example below the total count for the category "Tropical Costa Rica" is 9, which is what I want to diplay for each date under that category. Each date has a status associated to it and there are 3 statu's selected in the slicer. The line items totals are showing the total number of dates based on the status associated to the date. If all status' were selected there are a total of 12 dates, so if I was to use a count ignoring the status filter each date would show as 12 rather than 9. Is there any way I could write a forumla to the total count for the category under each line item based on the slicer selection?

Current forumla: Calculate(Countrows('Data'),Allexcept('Data','Data'[Name],'Data'[Month]))Example.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sflynn , Not very clear, Try a measure like

Calculate(Countrows('Data'),filter(allselected('Data'),'Data'[Name] = max('Data'[Name]) && 'Data'[Month] =max('Data'[Month])))

View solution in original post

5 REPLIES 5
sflynn
Helper I
Helper I

Please see the following link to the pbx file with example data: https://1drv.ms/u/s!ApuQfyu6Yovsak-ZgMJmN3VH79s?e=oCnr1u 

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@sflynn , Not very clear, Try a measure like

Calculate(Countrows('Data'),filter(allselected('Data'),'Data'[Name] = max('Data'[Name]) && 'Data'[Month] =max('Data'[Month])))

That worked! Thank you for help, very much appreciated.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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