Forum Discussion
Anonymous
6 years agoNot applicable
Count control by Date Slicer
Hi Experts, Please find the PBIX Download Here There is a measure to calculate "Count", "Units", "Sales", "Margin", the values will be changed by the Date slicer Value by Class =
VAR curr...
- 6 years ago
Anonymous , count calculation is wrong
Try
Value by Class = VAR currentClassTable = FILTER(ALLSELECTED('Sales table'[Product]), [Class] in values('Pareto classification'[Product class])) RETURN SWITCH (SELECTEDVALUE('P&L'[P&L]), "Count", SUMX(currentClassTable, CALCULATE(DISTINCTCOUNT('Sales table'[Product])))// COUNTROWS(currentClassTable) , "Units" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Units]))) , "Sales" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Sales]))) , "Margin", SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Margin]))))
amitchandak
6 years agoSuper User
Anonymous , count calculation is wrong
Try
Value by Class =
VAR currentClassTable = FILTER(ALLSELECTED('Sales table'[Product]), [Class] in values('Pareto classification'[Product class]))
RETURN
SWITCH (SELECTEDVALUE('P&L'[P&L]),
"Count", SUMX(currentClassTable, CALCULATE(DISTINCTCOUNT('Sales table'[Product])))// COUNTROWS(currentClassTable)
, "Units" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Units])))
, "Sales" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Sales])))
, "Margin", SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Margin]))))Anonymous
6 years agoNot applicable
amitchandak It's work now, many thanks