Forum Discussion
Flag all IDs from a certain category
- 2 years ago
First image is without any selection in the slicer. As you can see the flag is working fine for the Products that have Details as "Discounted".
Second image AAA2 product is selected and the flag shows 0 for everything.
Third Image AAA3 product is selected amd the flag shows 1 for AAA3.
I hope that this will help you or a least drive you to the right path! - 2 years ago
Try this:
Flag = VAR _table = SUMMARIZE ( 'Fact', 'Fact'[ProductID], dim[Subcategory], dim[Details], "new column", IF(CONTAINSSTRING(dim[Details],"Discounted"),1,0)) VAR _flag= IF(MAXX(SUMMARIZE(_table,dim[Subcategory],[new column]),[new column])=1,"Discounted","Non Discounted") RETURN _flagNow if a product has "Discounted" the entire Subcategory is "Discounted".
Hi, you may use conditional column like:
Flag_Discounted = IF(Subcategory_Name = "MIS"),1,0)
If this resolves your problem then please mark it as Solution, Thanks.
Hi, I can't use a calculated column because I am using Direct Query in my original data model so I can't add any new columns, I need to use a measure.
Also, I want the flag to be dynamic, I can't hardcode the value like in your formula, MIS was just an example that I used.
Thank you!