Forum Discussion
engyin2
8 years agoFrequent Visitor
Need Help on DAX formula..
Hi I wrote the below measure in BI to have the result of the no. of reporting as shown in excel. Span = CALCULATE(COUNT(WD[Workday ID])) / CALCULATE(COUNT(WD[Is Manager]), FILTER(WD, WD[Is Manag...
- 8 years ago
Hi engyin2,
First your error, it is because that the Column Layer is a Text type column. It cannot be used to minus 1 directly. To resolve this error, you just need to change the column typle to whole number.
Then to achieve your requirement, you can try following measure:
Span = CALCULATE ( COUNT ( WD[Layer] ), FILTER ( ALL ( WD ), WD[Layer] = SELECTEDVALUE ( WD[Layer] ) + 1 ) ) / CALCULATE ( COUNT ( WD[Layer] ), FILTER ( WD, WD[Is Manager] = "Yes" ), ALLEXCEPT ( WD, WD[Layer] ) )Thanks,
Xi Jin.
Zubair_Muhammad
8 years agoCommunity Champion
Try this MEASURE
Span =
CALCULATE ( COUNT ( WD[Workday ID] ) )
/ CALCULATE (
COUNT ( WD[Is Manager] ),
FILTER (
ALL ( WD ),
WD[Is Manager] = "Yes"
&& WD[Layer]
= SELECTEDVALUE ( WD[Layer] ) - 1
)
)engyin2
8 years agoFrequent Visitor
Hi,
Thanks for your help. But it dun really work. Any idea ? I have the below message prompted :
- v-xjiin-msft8 years agoSolution Sage
Hi engyin2,
First your error, it is because that the Column Layer is a Text type column. It cannot be used to minus 1 directly. To resolve this error, you just need to change the column typle to whole number.
Then to achieve your requirement, you can try following measure:
Span = CALCULATE ( COUNT ( WD[Layer] ), FILTER ( ALL ( WD ), WD[Layer] = SELECTEDVALUE ( WD[Layer] ) + 1 ) ) / CALCULATE ( COUNT ( WD[Layer] ), FILTER ( WD, WD[Is Manager] = "Yes" ), ALLEXCEPT ( WD, WD[Layer] ) )Thanks,
Xi Jin.