Forum Discussion
duncanUK
5 years agoFrequent Visitor
Using measures within a SUMX
Hi, I'm struggling with some DAX and hope somebody can point me in the right direction please. I'm trying to count the number of stores which are below the average for other stores which are ...
- 5 years ago
duncanUK , try like
SUMX ( summarize ( Sales, Sales[Store_Name] , Sales[format], "_1", if([LY Sales Amt] > 0 , [Neg_YoY_vs_Format_Store],0 )), [_1])
amitchandak
5 years agoSuper User
duncanUK , Try like
Negative vs Format Avg Stores =
SUMX ( VALUES ( Sales[Store_Name] ), if([LY Sales Amt] > 0 , [Neg_YoY_vs_Format_Store],0 ))
duncanUK
5 years agoFrequent Visitor
Hi amitchandak
Thanks for looking at this, but unfortunately that gives the same results, with a total of 1 rather than 7.
- amitchandak5 years agoSuper User
duncanUK , try like
SUMX ( summarize ( Sales, Sales[Store_Name] , Sales[format], "_1", if([LY Sales Amt] > 0 , [Neg_YoY_vs_Format_Store],0 )), [_1])
- duncanUK5 years agoFrequent Visitor
Perfect, thank you that worked