Forum Discussion
vinaydavid
6 years agoHelper III
DAX Calculation
Hi All, I am planning to plot the below data into a stacked bar graph. With Week on the X-axis (values like Curr.wk, forecast, +1 wk.....+3wk). And on Y-axis I want to plot Type (XX, YY, ZZ ......
v-deddai1-msft
6 years agoCommunity Support
Hello @vinaydavid ,
Please try the following measurement:
Measure =
IF (
HASONEVALUE ( 'Table'[Category] ),
CALCULATE (
DIVIDE ( COUNTROWS ( 'Table' ), AVERAGE ( 'Table'[Capacity] ) ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
),
SUMX (
SUMMARIZE (
'Table',
'Table'[Category],
"_a", CALCULATE (
DIVIDE ( COUNTROWS ( 'Table' ), AVERAGE ( 'Table'[Capacity] ) ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
),
[_a]
)
)
If this post helps, then consider Accepting it as the solution to help other members find it more quickly.
Best regards
Dedmon Dai