Forum Discussion

Ed2563's avatar
Ed2563
Frequent Visitor
1 year ago
Solved

Cannot Clone Measure

If this has already been asked, I apologize.  I could not find a solution searching for either "Clone" or "Copy."

I am trying to create a copy of an existing measure that I have.  The Measure is a simple if...then.  See below.

Company A On-Time = 
IF(
     'table1'[Delta] >= -60 && 'table1'[Delta] <= -15,
     TRUE(),
     FALSE()
)

I am attempting to make a copy of this measure for Company B and change the last Delta criteria, but Power BI says it can't find my Delta measure.

It makes no sense, becasue the original works fine.

Any assistance will be greatly appreciated!

  • Ed2563 

    are you creating a column? You can't use current measure when you are creating a column

     

    or you can try 

     

    Company A On-Time = 
    IF(
       max( 'table1'[Delta]) >= -60 &&max( 'table1'[Delta] )<= -15,
         TRUE(),
         FALSE()
    )

     

    if this does not work, pls provide some sample data and expected output

9 Replies

  • Ed2563 

    are you creating a column? You can't use current measure when you are creating a column

     

    or you can try 

     

    Company A On-Time = 
    IF(
       max( 'table1'[Delta]) >= -60 &&max( 'table1'[Delta] )<= -15,
         TRUE(),
         FALSE()
    )

     

    if this does not work, pls provide some sample data and expected output

    • Ed2563's avatar
      Ed2563
      Frequent Visitor

      Thanks for the response.
      No, I copied the code, selected "Create New Measure', and then pasted the clipboard contents.  See below:

    • Ed2563's avatar
      Ed2563
      Frequent Visitor

      Thanks!!!  I tried your proposed solution using MAX (even though it wasn't in the original measure) and it worked!  Kudos and thank you again! 

  • Deku's avatar
    Deku
    Super User

    If [delta] is a measure, the convention is to not give the table name, so show that is a measure. I have to assume to new semantic model, if it does have a [delta] measure, then maybe it is not in 'table1'? Removing the table reference will make the location of the measure irrelevant 

    • Ed2563's avatar
      Ed2563
      Frequent Visitor

      Thanks for the response.
      Removing the table name didn't help.

  • There is no mechanism for that.  You need to copy the measure code, then create a new measure, paste the code and modify it accordingly.

    • Ed2563's avatar
      Ed2563
      Frequent Visitor

      See the response above. I was trying to copy the contents of an existing measure into a new measure, not actually try to find a "clone" mechanism.

  • Deku's avatar
    Deku
    Super User

    The a2c measure is red, meaning it is not in the model. Need to copy that one in too