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
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
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.