Forum Discussion

PowerBITestingG's avatar
PowerBITestingG
Resolver I
2 years ago
Solved

Calculation Item Totals formatting

I have a matrix with Sales per Month and then MTD, YTD as calculation items. In order to show MTD, YTD without having one per month, I am using IF(NOT(ISINSCOPE(Months),MTD)) and then I drill on "Co...
  • PowerBITestingG's avatar
    2 years ago

    So you can create a new conditional measure that checks each calculation item that you want to format or/and excludes the others

    ConditionalFormat =
     var thisitem=
     SELECTEDVALUE('CalcGroup'[Name])

     return
     SWITCH(TRUE(),
      thisitem IN {"YTD"},[YTD],
       thisitem IN {"Months"},[TotalQuantity],
       BLANK())
     
    then you can use the formula below for your calculation items, so that it uses the conditional formatting measure 

    IF (
    SELECTEDMEASURENAME () = "ConditionalFormat",
    SELECTEDMEASURE (),
    IF (
    NOT ( ISINSCOPE ( [Months] ) ),
    [YTD]
    )
    )

    Conditional Formatting of Calculation Group Columns in Power BI
    https://www.youtube.com/watch?v=TpD57zS2sQU