Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
My scenario:
Do I add one additional column for DAX formulas to be used when KPI is selected or create each KPI as indivudual DAX formula?
How do I refer these in DAX formula?
Example:
I choose to show "Sales" on my line visual. I think that the simplest way is to use sum(Sales) KPI and refer to this in IF() or SWITCH() clause.
value = if ( selectedvalue ( KPI ) = "Sales" , [Sales] , null)
But how this changes if I have another column that says which KPI to use or it says what DAX to use?
@nebulus , Are you looking to change measure based in slicer value ?
example
value = Switch( selectedvalue ( KPI ) ,
"Sales" , [Sales]
"COGS" , [COGS]
, blank())
use blank() in place of null, in you, if, if that is the only change you need
refer if needed
measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
Thank you for your answer @amitchandak
This solution is the same as I described on my post. My problem is that I have over 40 measures and there will be more in the future.
I have following table that I would like to use:
| KPI | DAX expression | Measure name |
| Sales | sum(Sales) | [Sales] |
| COGS | sum(COGS) | [COGS] |
value = min ( DAX expression )
or
value = min ( Measure name )
Is there a way to convert text to DAX expression of to refer to created measure?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 10 | |
| 10 | |
| 8 | |
| 8 |