The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am attempting to make a calculated column which creates a flag when a value in the table has been selected.
The filters are applied to a dimension table which is joined to my fact table on the Prime_ID.
You can see there are 25 matches betweent those two tables, in this example with certain slicers selected.
But when I write the DAX to flag the Prime_ID if it is among the selected values, they all result in "selected".
I have tried writing this using containsrow, but the result is the same.
@talespin How do you recommend I do that?
I need a dynamic flag which updates according to the slicer selections.
I will then use that flag in the partitionby clause of a rownumber function. (the row numbers will be used to calculate decile rankings, but that is down the line. And I'm currently stuck at square one)
hi @AABright
I am not sure if you need to be at square one, there might be better approach to doing what you want to do, since we do not have any detail on your requirement, so here is my try to address square one.
You see Dim and Orders table linked on code(Integer field).
Slicer contains code from Dim table and Table visual contains all attributes from Orders table.
Create this measure
---------------------------------------------------------------
That worked great to create the flag. Thanks @talespin
Unfortunately my plan to drop that result into the partitionby clause of a rownumber function does not work. It looks like you cannot reference a calculated measure there.
I am going to write a new question on how to create dynamic decile ranking. My research for that hasn't been fruitful.
hi @AABright
"I am attempting to make a calculated column which creates a flag when a value in the table has been selected."
This is not possible, Calculated colums are refreshed during report refresh and are not influenced by slicers. You need to create measure.
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |