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

DAX help with total sum by category

I need help writing a DAX statement total by group, called BeerStyle. 

 

dax01.JPG

I'm filtered to a style of Brown Ale and year 2018

I can get the totals of the complete table with no filter:

CE by Style Total 4 = SUMX (
     VALUES ( 'FactVwDwEoStarPBIOrders'[BeerStyleKey]), CALCULATE(SUM('FactVwDwEoStarPBIOrders'[Case Equivalency] ), 
    ALL('FactVwDwEoStarPBIOrders'))
)
This is the 38 million value
 
This is not what I want. I want the total of just brown ales and (other style groups like amber ale) showing as the total per line. 
 
Experimenting I created the DAX below, but it is hard coded and doesn't filter by the year of the slicer. 
 
CE by Style Total 7 = SUMX (
    VALUES ( 'FactVwDwEoStarPBIOrders'[BeerStyleKey]), CALCULATE(SUM('FactVwDwEoStarPBIOrders'[Case Equivalency] ),
    ALL('FactVwDwEoStarPBIOrders'), FactVwDwEoStarPBIOrders[BeerStyleKey]=71)
)
This produces 100,000 for the three years.
 
How do I create the totals by style and have the slicers work?
 
 

 

1 REPLY 1
technolog
Super User
Super User

Can you please tell me if the problem is still relevant? If you managed to solve it in some way, please write here how you solved this problem. Then it will be possible to mark this problem as solved.

If not, it may make sense to ask the question again, thus confirming the relevance of this problem.

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