Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Marcuskwil
Frequent Visitor

Measure written as text string in a lookup table?

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.

Marcuskwil_0-1617713045402.png

Marcuskwil_1-1617713120623.png

 

"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?

 

 

4 REPLIES 4
Anonymous
Not applicable

@Marcuskwil 

 

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:

Marcuskwil_0-1617871161467.png

Then I'm able to use a Switch to jump between the different Transformation logics:

Marcuskwil_1-1617871281011.png

That way I'm able to have 1 measure for all the visuals and then filter the respective visual on the KPI I want.

Anonymous
Not applicable

@Marcuskwil 

 

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.

amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.