Forum Discussion

Yonah's avatar
Yonah
Helper II
4 years ago
Solved

Power BI conditional formatting per column in Matrix

Hello, I have a matrix in PowerBI with rows item category, item description, the column Year and the values Sales before Returns, Returns in Euro and Returns Quotas. The data looks like this: Ar...
  • Yonah's avatar
    4 years ago

    I found a Soulotion. 
    First, I calculated the Amount of Return.

    To get the Amount of Return per Year/per Column, I used this Measure:

    Returns per year = DIVIDE(CALCULATE(Messure[Returns in Euro],ALLSELECTED(T1[ItemCategoryReference])),CALCULATE(Messure[Sales before Returns],ALLSELECTED(T1[ItemCategoryReference]),0)*100

    To get the Return Ratio. I used this Measure

    Returns ratio = DIVIDE(Messure[Returns in Euro],Messure[Sales before returns],0)*100


    For the Color-Condion 
    Color 2 = if(Messure[returns rate]>Messure[returns per year], "red", "green")
    I then used Color 2 as Field value in conditional formatting.


    Color2 = if(Messure[returns rate]>Messure[returns per year], "red", "green")