Forum Discussion

CAVCX's avatar
CAVCX
Frequent Visitor
4 years ago
Solved

Show MoM +/- using color in a Matrix

Hello,   I have a Matrix in which I have a list of customers in rows, and their consumed volume over the last 3 months in 3 columns. I want to a. Background fill the cell in the second and third ...
  • amitchandak's avatar
    4 years ago

    CAVCX , With help from Date table and time intelligence create meausres like

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
    last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

    diff = [MTD Sales]-[last MTD Sales]
    diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

     

    then create a color Meausre and use that in conditional formatting using field value 

     

    Color = Switch( true() ,

    not(isblank(Last MTD sales])) && diff % >= 0, "Green",

    not(isblank(Last MTD sales])) && diff % < 0, "Red",

    "White")

     

    How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

     

    Power BI — Month on Month with or Without Time Intelligence
    https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
    https://www.youtube.com/watch?v=6LUBbvcxtKA