cancel
Showing results for 
Search instead for 
Did you mean: 
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

Accepted Solutions
affan Established Member
Established Member

Re: DAX: Measure if Column="SomeValue

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 Super Contributor
Super Contributor

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)
)
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Anonymous
Not applicable

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

 

affan Established Member
Established Member

Re: DAX: Measure if Column="SomeValue

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

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 254 members 2,710 guests
Please welcome our newest community members: