Forum Discussion

dokat's avatar
dokat
Post Prodigy
2 years ago
Solved

Dax If statement not working correctly.

Hi,   I have below dax code i'd like it change background color of the shape to red (rgba(255, 255, 255, 1)) when "Last Month" is selected in slicer  or else transperant background color rgba(255, ...
  • tharunkumarRTK's avatar
    tharunkumarRTK
    2 years ago

    v-yanimei-msft 

    Power BI accepts "rgba(255,255,255,0)", as you can see in the below image. I created two measures, [measure 2]and [measure 3] and used them in the background color for the shapes. And if you you observe both are working as per the condition


    Measure 3 = if (10<1, "rgba(255,255,255,1)","rgba(255,255,255,0)") 
    
    Measure 2 = if (10>1, "rgba(255,255,255,1)","rgba(255,255,255,0)")