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

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

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: 352 members 3,266 guests
Please welcome our newest community members: