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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Change column based on measure value

Hi everyone,

 

I know you have an idea what can be the problem, and how to solve it.

The situation is the following:

I have created a measure based on filter value. DAX:

 

 

 

Measure = IF(FILTERS('TABLE_1'[column_1]) = "1", TRUE(), FALSE())

 

 

 

This measure works. If I change the filter, the value updates correctly.

 

I have a table (TABLE_2) that contains two column, lets call it "A" and "B". I want to create a new column ("C"). This column should be the same with "A" or "B" columns, based on my measure. DAX:

 

 

CreatedCol = IF([Measure] = TRUE(), TABLE_2[A], TABLE_2[B])

 

 

And it comes with a following error: "A table of multiple values was supplied where a single value was expected."

If I update the DAX of the new column to 

 

 

CreatedCol = IF(TRUE() = TRUE(), TABLE_2[A], TABLE_2[B])

 

 

or

 

 

CreatedCol = IF(FALSE() = TRUE(), TABLE_2[A], TABLE_2[B])

 

 

, it works.

 

So both the measure and the column work separately, but when I combine them, it breaks.

I hope you can save me.

Thanks in advance!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

You cannot create column "C" based on your measure's value. 

Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.

 

In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.

 

You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns

 

Best Regards,
Community Support Team _ kalyj

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , In DAX measure you need to have aggregation

CreatedCol = IF([Measure] = TRUE(), Max(TABLE_2[A]), max(TABLE_2[B]))

or

CreatedCol = IF([Measure] = TRUE(), sum(TABLE_2[A]), sum(TABLE_2[B]))

 

 

Also , you can not use measure in a column

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
Anonymous
Not applicable

Dear @amitchandak,

thank you for your answer!

So as I understand if "TABLE_2[A]" and "TABLE_2[B]" are string columns, it is not possible to create column "C" based on my measure's value?

Hi @Anonymous ,

You cannot create column "C" based on your measure's value. 

Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.

 

In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.

 

You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns

 

Best Regards,
Community Support Team _ kalyj

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.