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
Ssibbett
Frequent Visitor

DAX Selectvalue() does not work with Dynamic Calculation Columns

Hello, 

I'm new to power BI. 

I have created table "Units" that has two choices (below). This is used in a Slicer. 

Selected UnitsChoice
Acre-Feet1
Million Galons2

I have a measure with formula: Units Value = LOOKUPVALUE(Units[Choice],Units[Select Units], SELECTEDVALUE(Units[Select Units],"Million Gallons"))

The information for the measure displays correctly on the Card. 

I have another table "Volumes" with volumes and various units for volumes. I want to allow the user to choose one unit type from "Units" table for the report display. I added a New Column to the "Volumes" table with the formula: 

Volumn UOM = SWITCH(Units[Units Value],1,[To AF]*[Volume],2,[To MG]*[Volume],0).
The report will result in the alternative "Million Gallons" dispite changes to the slicer. The Card does change values with the slicer. If I change SELECTEDVALUE(Units[Select Units],"Acre-Feet") then the report will be in "Acre-Feet". 
 
I have also tried using parameter for the same purpose but the results are the same. I have also tried using the formula: Units Value =  LOOKUPVALUE(Units[Choice],Units[Select Units], IF(HASONEVALUE(Units[Select Units]),VALUES(Units[Select Units]))), but that does not work. 
 
I believe this should work because there are some article that say so, https://spr.com/powerbi-dynamic-calculations/ 
 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

Columns are not dynamic, they are calculated at data load so they cannot change when you change a slicer. You need a measure.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

If I put the column formula in a measure, the measure will not calculate values for each row. 

Here is my column formula Volumn UOM = SWITCH(Units[Units Value],1,[To AF]*[Volume],2,[To MG]*[Volume],0).  How do I make this into a measure? 

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