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

DAX: Measure if Column="SomeValue

 
Hello
My goal is to create a measure that contains a condition on the column (STP code)
the measure does not accept the column (can not be determined.
Opening time = IF (DWPROD [ST_CODE] = "VEL"; CALCULATE (DWPROD [Time stamp 2] -1800) / 3600; (CALCULATE (DWPROD [Time stamp 2] - 3600) / 3600))
thank you in advance
1 ACCEPTED SOLUTION

Hi @Anonymous

 

What about trying 

 

Opening time = IF (FIRSTNONBLANK(DWPROD [ST_CODE],1)= "VEL"; CALCULATE (DWPROD [Time stamp 2] -1800) / 3600; (CALCULATE (DWPROD [Time stamp 2] - 3600) / 3600))

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

what you described should work fine as a calculated column in DWPROD, why not do that?

Opening time = 
IF (
    DWPROD [ST_CODE] = "VEL"; 
    (DWPROD [Time stamp 2] - 1800) / 3600; 
    (DWPROD [Time stamp 2] - 3600) / 3600)
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

thanks for your answer but the STP code is not supported because it's a column

 

Code daxCode dax

 

Hi @Anonymous

 

What about trying 

 

Opening time = IF (FIRSTNONBLANK(DWPROD [ST_CODE],1)= "VEL"; CALCULATE (DWPROD [Time stamp 2] -1800) / 3600; (CALCULATE (DWPROD [Time stamp 2] - 3600) / 3600))

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

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.