Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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:
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:
What am I missing?
Solved! Go to Solution.
@Anonymous ,
sumx(values(table[customer]),Total Market Sales =
CALCULATE (
[Total Volume Sales],
ALLEXCEPT ( fSales, dProducts[Category] ),
KEEPFILTERS ( VALUES ( dDates[Date] ) ),
KEEPFILTERS ( VALUES ( dProducts[Manufacturer] ) )
)
)
@Anonymous ,
sumx(values(table[customer]),Total Market Sales =
CALCULATE (
[Total Volume Sales],
ALLEXCEPT ( fSales, dProducts[Category] ),
KEEPFILTERS ( VALUES ( dDates[Date] ) ),
KEEPFILTERS ( VALUES ( dProducts[Manufacturer] ) )
)
)
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
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |