Forum Discussion
Slicer parameter in DAX
Not entirely sure I understand this, but if you are trying to use a dynamic measure in a calculated column you are not going to have success. Calculated columns are calculated at the time of data load so selecting a measure in a slicer is not going to have any impact on your calculated column.
Hello Greg_Deckler
Does this example help ?
What I want to acheive is just adding an "X" in the rows where 70024 is between Minimum (70016) and Maximum (70034 in the example).
The number "3" comes from the Measure I've been trying to use as an alternative to identify the rows.
It works, since I only have a number when the equation is True, but I cannot use it to filter the table since it's a measure.
That's why I though of a calculated column that I could use latter as a filter.
Does that make more sens ?
- Greg_Deckler7 years agoCommunity Champion
I don't know why you can't use a measure to filter a table visual, I can. So, if you create a Measure like:
Status = IF(MAX([My Parameter]) >= MAX([Minimum]) && MAX([My Parameter]) <= MAX([Maximum]),"X",BLANK())
Then just put that into your table visual and filter the measure where Status is X
- v-cherch-msft7 years agoMicrosoft Employee
Hi SA800029
It seems you may use visual level filter. Below is the post for your reference.
https://community.powerbi.com/t5/Desktop/Need-help-in-DAX/m-p/564906#M266573
Regards,
Cherie
- Anonymous7 years agoNot applicable
Hello,
Sorry for answering late, our company has switched account, I had to create a new one, anyway.
Thank you for your advices, I see that my problem wasn't clear. I don't have any trouble filtering the table using a measure, what I need to do is to use this measure to filter my model.
Greg, your formula works fine, but it only applies a visual filter on my table.
Do you think it's possible ?
Here's a picture of (part) of the model if it helps :
"Table Avions" is the parameter used in the slicer
"MSN Effectivity" is the table I've been trying to add the calcultaed column / measure to filter the rest of my modelThank you,
- Anonymous7 years agoNot applicable
Hi,
For those of you who would encounter the same problem I found a way to get around my problem.
I had to change the table "MSN Effectity" : instead of having a table with : Key / Min range / Max Range, I've duplicated the lines (Key) for each MSN, so I end up with : Key / MSN (where Key "i" is repeated "n" times, "n" being the difference between Min Range and Max Range for the specified Key).
I plugged my column "MSN" to a slicer and it work perfectly.
Thank you for your support and happy new year,