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

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.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors