Forum Discussion
dax measure help
Hi Power Users,
I'm new to power bi and learning. I'm trying to move tableau dash boards to power bi and struck with one measure.
Tableau Measure
CASE [Business Unit]
WHEN "ABC" THEN (IF([Date] > TODAY()) THEN FALSE
ELSE TRUE
END)
WHEN "CDE" THEN (IF([Date] > TODAY()) THEN FALSE
ELSE TRUE
END)
END
This measuew specifies if events are scheduled for future dates.
I need convert this measure to DAX.
Please help.
Thanks
- Anonymous6 years ago
Hi,
Create a calculated column using this below code.
Column = IF([Business Unit] = "ABC", IF(VALUE([DATE]) > VALUE(TODAY()),"FALSE","TRUE"),IF('Table'[Business Unit]="CDE",IF(VALUE([DATE]) > VALUE(TODAY()),"FALSE","TRUE")))orColumn 2 = SWITCH([Business Unit],"ABC",IF(VALUE([Date]) > VALUE(TODAY()),FALSE(),TRUE()),"CDE",IF(VALUE([Date]) >VALUE(TODAY()),FALSE(),TRUE()))Did I answer your question? If Yes, Give me a Kudo
4 Replies
- Greg_Deckler
Community Champion
Should be something like:
SWITCH([Business Unit], "ABC",IF([Date] > TODAY(),FALSE(),TRUE()), "CDE",IF([Date] > TODAY(),FALSE(),TRUE()) ) - AnonymousNot applicable
Hi,
Create a calculated column using this below code.
Column = IF([Business Unit] = "ABC", IF(VALUE([DATE]) > VALUE(TODAY()),"FALSE","TRUE"),IF('Table'[Business Unit]="CDE",IF(VALUE([DATE]) > VALUE(TODAY()),"FALSE","TRUE")))orColumn 2 = SWITCH([Business Unit],"ABC",IF(VALUE([Date]) > VALUE(TODAY()),FALSE(),TRUE()),"CDE",IF(VALUE([Date]) >VALUE(TODAY()),FALSE(),TRUE()))Did I answer your question? If Yes, Give me a Kudo - ChrisMendoza
Resident Rockstar
Anonymous -
Try
Measure = SWITCH ( SELECTEDVALUE ( TableName[Business Unit] ), "ABC", IF ( SELECTEDVALUE ( TableName[Date] ) > TODAY (), FALSE(), TRUE() ), "CDE", IF ( SELECTEDVALUE ( TableName[Date] ) > TODAY (), FALSE(), TRUE() ), -1 )- AnonymousNot applicable
Sorry, I didn't inform earlier that the business unit feild is in separate table and that business unit as a slicer. when user select the business unit then i need to create sepate column and that column i need to use as slicer.