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 )
Ashish_Mathur
8 years agoSuper User
Hi,
Why would you need something like this?
- Create a relatioship from the Product Name column of the Sales table to the Product Name column of the Product Dimension Table.
- Drag the three columns from the Product Dimension table
- Write this calculated field formula
=SUM(Data[Sales])
This will create a visual with 2 columns.