Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm creating a lookup table to write measures/definitions of multiple KPI, I intend to do this to avoid creating many Measures and instead filtering a visual on the selected KPI.
"Formula" just returns the text string, is there a way in which I can get Power BI to evaluate the expression returned by the Variable?
Such things are not possible. DAX does not calculate formulas dynamically. The closest you could arrive at is CALCULATION GROUPS but still, they are not dynamic formulas in the sense you'd like them to be.
I think I've managed to create a flexible workaround.
First I created a table with the KPI's I want to have available with their respective transformation:
Then I'm able to use a Switch to jump between the different Transformation logics:
That way I'm able to have 1 measure for all the visuals and then filter the respective visual on the KPI I want.
This is the standard way to obtain a measure that will be returning different measures depending on choices. Nothing to do with the dynamic behavior you wanted 🙂 If you had asked your question in a different way, someone would most likely have given you this very pattern.
@Marcuskwil , You should explore calculation group for that
calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/
https://www.youtube.com/watch?v=vlnx7QUVYME
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
46 | |
39 | |
19 | |
19 |