Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX condition if

Hello,   I have many tables in power query that I don't want to merge. I'd like thanks to DAX to do somethong like this :    If ('Tab1'[Type] = "Pipe") then return 'Tab1'[thickness]  * Tab2[surf...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Assuming that you have a relationship between Data Table and Size Table.

     

     

     

     

    Using MEASURES

     

    Thickness*Size =

    SWITCH(
    TRUE(),
    MAX(Data[Type]) = "Pipe" && MAX(Data[Size]) = MAX(Size[Size]), MAX(Data[thickness]) * MAx(Size[new_size]),
    MAx(Data[thickness])
    )

     

     

     

     

     

    USING A CALCULATED COLUMN

     

    Thickness*Size Column =

    SWITCH(
    TRUE(),
    Data[Type] = "Pipe" && Data[Size] = RELATED(Size[Size]), Data[thickness] * RELATED (Size[new_size]),
    Data[thickness]
    )
     
     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)