Reply
Frequent Visitor
Posts: 6
Registered: ‎11-20-2018
Accepted Solution

DAX: Measure if Column="SomeValue

[ Edited ]
 
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

Accepted Solutions
Highlighted
Established Member
Posts: 201
Registered: ‎07-12-2017

Re: DAX: Measure if Column="SomeValue

[ Edited ]

Hi @azizzehani

 

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


All Replies
Super User
Posts: 866
Registered: ‎06-23-2016

Re: DAX: Measure if Column="SomeValue

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)
)
Frequent Visitor
Posts: 6
Registered: ‎11-20-2018

Re: DAX: Measure if Column="SomeValue

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

 

aaz.pngCode dax

 

Highlighted
Established Member
Posts: 201
Registered: ‎07-12-2017

Re: DAX: Measure if Column="SomeValue

[ Edited ]

Hi @azizzehani

 

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