Forum Discussion
Creating dynamic groups based on a measure
- 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.
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.
- Petanek3333 years agoHelper III
Thank you very much v-jingzhang , this is exactly what I was looking for.
- Petanek3333 years agoHelper III
Hi v-jingzhang , the measure works with this visual as expected. However, if I understand it right, those categories (Running Out, ...) are only created in a virtual table or in a measure, but is there any way to link to them in another visual?
Let's say I want to drillthough Running Out Category in this setup:
I can drillthrough for example Product C in Running Out category, but if I want to drillthrough more than one selection, I can use a trick with a card visual.
If I click Product C and Product D holding Ctrl key, I basicaly selected the whole Running Out category and if I right-click the card visual and drillthrough, I successfully drillthrough to 10k.
But if I click the Running Out category as a whole and then want to drillthrough via card visual, I get 14 381 EUR (thats everything for given week) and not only the Running Out category.
I think that happens because the Running Out category is only defined in that measure so my question is, is there any other way so that the drilling through would work?