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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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