cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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])))

Anyone knows how to fix this.

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

1 ACCEPTED SOLUTION
Community Support

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.

8 REPLIES 8
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?

Community Support

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.

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

@Ashish_Mathur  - It still gives the error.

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.?

Super User

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
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.

Helper II

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

Super User

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors