Forum Discussion

jananagarajan's avatar
jananagarajan
Regular Visitor
3 years ago
Solved

How to write a logical if statement for the index

How to write a logical if statement for the index  Have written the same calculation in excel and would like to write the same in DAX IF(C3<>"",C3/$C$3,"")   Sample Data is attached   Custom...
  • Jihwan_Kim's avatar
    3 years ago

    Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

     

    Calculation CC =
    VAR _fixvalue =
        SUMX (
            FILTER ( Data, Data[Customer ID] = "T03" && Data[Temp] = 27 ),
            Data[Value]
        )
    VAR _result =
        DIVIDE ( Data[Value], _fixvalue )
    RETURN
        IF ( _result > 1, BLANK (), FORMAT ( _result, "#0.0%" ) )