Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PowerBITestingG
Resolver I
Resolver I

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 "Columns"


The challenge I am facing is in how to apply a different conditional formatting to MTD and YTD. Because any format that I apply to Totals get applied to both. I even tried using somethign like:

IF(SELECTEDVALUE(CalcGroup[Periods])in {"MTD"},[TotalQuantity],BLANK())
 
But it still gets applied to both. Any ideas?
1 ACCEPTED SOLUTION
PowerBITestingG
Resolver I
Resolver I

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

View solution in original post

1 REPLY 1
PowerBITestingG
Resolver I
Resolver I

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.