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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Grand Total measure shows empty dimensions

I want to calculate each customer's share of market by category. I have a market dimension table which contains 9 customers, but my fact table only has 2:

 

RayKristoph_0-1593918247138.png

 

I created a measure to calculate Total Market Sales for each week and category as follows:

 

Total Market Sales =
CALCULATE (
    [Total Volume Sales],
    ALLEXCEPT ( fSales, dProducts[Category] ),
    KEEPFILTERS ( VALUES ( dDates[Date] ) ),
    KEEPFILTERS ( VALUES ( dProducts[Manufacturer] ) )
)

 

 

The formula outputs the correct totals, but shows all 9 markets in my dimensions table instead of just the 2 active ones:

RayKristoph_1-1593918356322.png

What am I missing?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

sumx(values(table[customer]),Total Market Sales =
CALCULATE (
    [Total Volume Sales],
    ALLEXCEPT ( fSales, dProducts[Category] ),
    KEEPFILTERS ( VALUES ( dDates[Date] ) ),
    KEEPFILTERS ( VALUES ( dProducts[Manufacturer] ) )
)
)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

sumx(values(table[customer]),Total Market Sales =
CALCULATE (
    [Total Volume Sales],
    ALLEXCEPT ( fSales, dProducts[Category] ),
    KEEPFILTERS ( VALUES ( dDates[Date] ) ),
    KEEPFILTERS ( VALUES ( dProducts[Manufacturer] ) )
)
)
AllisonKennedy
Super User
Super User

This is because you're using CALCULATE and have asked it to ignore customer filter, so you'll get the same total for every customer in the table which is used in the visualizaton. Try using a SUMX instead or explain why you want the total for every customer and what your desired output is and we can help further.

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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