cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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))
1 ACCEPTED SOLUTION
Solution Sage

Hi @Anonymous

`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

3 REPLIES 3
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)
)```

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 dax

Solution Sage

Hi @Anonymous

`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

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.