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
RolinMartis
Helper II
Helper II

Error for a measure which is duplicate copy of another measure

Hi Team,

 

I have a Measure created which works perfectly without any error. But when i copy this measure formuale and paste it in a new meausre it gives me error.

 

Originial measure :

C_HC Budget = IF('REP 105 Labor & HC (1)'[Labor & HC]="HC Budget", IF( 'REP 105 Labor & HC (1)'[3rd month flag]=1, IF('REP 105 Labor & HC (1)'[Current Year HC flag]=1,'REP 105 Labor & HC (1)'[Budget])))
 
New Measure: Exact copy of above expression but i get error here.
Measure 6 = IF('REP 105 Labor & HC (1)'[Labor & HC]="HC Budget", IF( 'REP 105 Labor & HC (1)'[3rd month flag]=1, IF('REP 105 Labor & HC (1)'[Current Year HC flag]=1,'REP 105 Labor & HC (1)'[Budget])))
 
 
RolinMartis_0-1629973975334.png

Anyone knows how to fix this.

When original measure is working fine what is going wrong with duplicate of that?

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@RolinMartis 

 

You cannot just refer to a column in measure, every time you call out a column value in measure, you have add an aggregation function in front (max, min or sum). 


Measure 6 = IF(MAX('REP 105 Labor & HC (1)'[Labor & HC])="HC Budget", IF(MAX('REP 105 Labor & HC (1)'[3rd month flag])=1, IF(MAX('REP 105 Labor & HC (1)'[Current Year HC flag])=1,MAX('REP 105 Labor & HC (1)'[Budget]))))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
tfhodge
Regular Visitor

I've just found the same thing. But then realised that i wasn't copying a measure - I was copying the dax for a calculated column - which is a different kettle of fish. Was that the issue maybe?

V-pazhen-msft
Community Support
Community Support

@RolinMartis 

 

You cannot just refer to a column in measure, every time you call out a column value in measure, you have add an aggregation function in front (max, min or sum). 


Measure 6 = IF(MAX('REP 105 Labor & HC (1)'[Labor & HC])="HC Budget", IF(MAX('REP 105 Labor & HC (1)'[3rd month flag])=1, IF(MAX('REP 105 Labor & HC (1)'[Current Year HC flag])=1,MAX('REP 105 Labor & HC (1)'[Budget]))))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Does this work?

Measure 6 = IF(MAX('REP 105 Labor & HC (1)'[Labor & HC])="HC Budget", IF(MAX('REP 105 Labor & HC (1)'[3rd month flag])=1, IF(MAX('REP 105 Labor & HC (1)'[Current Year HC flag])=1,'REP 105 Labor & HC (1)'[Budget])))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  - It still gives the error.

RolinMartis_0-1630041115559.png

The problem is this expression works perfectly fine in another measure. I dont understand what is going wrong when i copy and paste it in another measure. Is it a bug in powerBI.?

Hi,

Share the download link of the PBI file and show the problem very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Do you still get an error with this version?

 

Measure 6 = IF('REP 105 Labor & HC (1)'[Labor & HC]="HC Budget" && 'REP 105 Labor & HC (1)'[3rd month flag]=1 && 'REP 105 Labor & HC (1)'[Current Year HC flag]=1,'REP 105 Labor & HC (1)'[Budget])

 

Also note that you are missing the "or else" decision statement.

Hi @lbendlin ,

 

I changed the expression as below and it worked.

 

Measure 6 =
CALCULATE(SUM('REP 105 Labor & HC (1)'[Budget]),
FILTER('REP 105 Labor & HC (1)', AND('REP 105 Labor & HC (1)'[3rd month flag]=1,'REP 105 Labor & HC (1)'[Labor & HC]="HC Budget")))
 
What i want to understand is -  In the same PBIX file one measure works fine withought any errors and the eact copy of it doesnt work. Is it a bug?
 
Regars,
Rolin
 

Which version of Power BI Desktop are you using? Latest is 2.96.901.0

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.