Forum Discussion
Petanek333
3 years agoHelper III
Creating dynamic groups based on a measure
Hi, I would like to create groups of data based on a measure. To be honest, I don't even know if it is possible. I have a table like this: It basicaly says that in a week number 33 there were...
- 3 years ago
Hi Petanek333
You can try this measure
Measure = VAR _table = SUMMARIZE('Dummy Data','Dummy Data'[ID],"week_remaining_new",[Weeks Remaining NEW],"max_week_inventory_value",[Max Week Inventory Value]) RETURN SWITCH(SELECTEDVALUE('Stock Category'[Type]), "N/A",SUMX(FILTER(_table,[week_remaining_new]<=0),[max_week_inventory_value]), "Running Out",SUMX(FILTER(_table,[week_remaining_new]>0 && [week_remaining_new]<=8),[max_week_inventory_value]), "Perfect",SUMX(FILTER(_table,[week_remaining_new]>8 && [week_remaining_new]<=18),[max_week_inventory_value]), "Too much",SUMX(FILTER(_table,[week_remaining_new]>18),[max_week_inventory_value]) )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Petanek333
3 years agoHelper III
I figured I could use a measure like this to create dynamic categories:
Category Measure =
SWITCH (
TRUE (),
[Weeks Remaining NEW] <= 0, "N/A",
[Weeks Remaining NEW] <= 8, "Running Out",
[Weeks Remaining NEW] <= 18, "Perfect",
"Too much"
)But since I cannot use a measure as a legend in a chart, I don't have a solution to my problem