Forum Discussion
Switch or If Function
- 1 year ago
The D_Index_Forum and the Seasonal Demand Index.
And the classification (your original request) do you do it on the sum of the values on the Seasonal Demand Index?
Instead of letting PowerBI to sum the values, please create a simple measure like this:
Total Demand Index = CALCULATE (SUM([Seasonal Demand Index])) - 1 year ago
You can do it either via a calculated column or a table to Legend.
Since this is a different topic I suggest you close this thread and do some digging first.
These may help:
- https://community.fabric.microsoft.com/t5/Desktop/How-can-I-plot-my-DAX-measure-as-a-legend-as-well-as-values/m-p/2423682#M867725- https://www.reddit.com/r/PowerBI/comments/13gpo7m/is_there_a_way_to_use_a_measure_as_legend_on_a/
- https://community.fabric.microsoft.com/t5/Desktop/Use-measure-as-chart-legend/m-p/1237315#M547738
Hope it helps.
Heya,
In the Switch function, don't bother with the mid value, go for something like this:
Demand Classification =
SWITCH(
TRUE(),
'ItemsOutbound'[Seasonal Demand Index] > 1.2, "High Demand",
'ItemsOutbound'[Seasonal Demand Index] < 0.9, "Low Demand",
"Stable Demand"
)Thank you, I tried but only stable demand is showing.
- MNedix1 year agoSolution Sage
Please check the formatting of the Demand Index values, they may be Text instead of Decimal numbers.
- reyesdjr1 year agoFrequent Visitor
Thank you, there is no text. I did check the data.
- MNedix1 year agoSolution Sage
Do a simple test, create two measures:
DC_1= IF('ItemsOutbound'[Seasonal Demand Index] > 1, "High Demand","N/A") DC_2= IF('ItemsOutbound'[Seasonal Demand Index] > 0, "High Demand","N/A")See which one returns garbage vs the data you have in your column. If both return N/A then there is something wrong with the data.