Forum Discussion
B_Smith
8 years agoFrequent Visitor
DAX Comparison Measure
Hello, sorry if there are multiples, was not appearing in the topic list! I'm trying to get a Dax calculation right for a measure and having some problems. I know it's some combination of allsele...
- Anonymous8 years ago
Try this:
[SubCategory Sales] = VAR CurrentSubCategory = VALUES ( ProductTable[Product Subcategory] ) RETURN CALCULATE ( SUM ( Sales[Sales] ), ALL ( ProductTable[Product Name] ), ProductTable[Product Subcategory] = CurrentSubcategory )and this:
[Category Sales] = VAR CurrentCategory = VALUES ( ProductTable[Product Category] ) RETURN CALCULATE ( SUM ( Sales[Sales] ), ALL ( ProductTable[Product Name] ), ProductTable[Product Category] = CurrentCategory )
Anonymous
8 years agoNot applicable
Try this:
[SubCategory Sales] =
VAR CurrentSubCategory =
VALUES ( ProductTable[Product Subcategory] )
RETURN
CALCULATE (
SUM ( Sales[Sales] ),
ALL ( ProductTable[Product Name] ),
ProductTable[Product Subcategory] = CurrentSubcategory
)and this:
[Category Sales] =
VAR CurrentCategory =
VALUES ( ProductTable[Product Category] )
RETURN
CALCULATE (
SUM ( Sales[Sales] ),
ALL ( ProductTable[Product Name] ),
ProductTable[Product Category] = CurrentCategory
)B_Smith
8 years agoFrequent Visitor
Thanks for this! I think that is working!