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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
riwer
Frequent Visitor

Calculation Groups and Measures

Hi Community!

I have a time intelligence calculation group, containing the following items:

Current Period = SELECTEDMEASURE()
PY = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Calendar'[Date]))
YoY = SELECTEDMEASURE() - CALCULATE(SELECTEDMEASURE(), 'Time intelligence'[Time calculation] = "PY")
These all work fine used in a matrix, together with a slicer where users can select which item (single select) they wish to see.

However, when I try to use these in a measure to for use in a dynamic title "Test title", i get some unexpected behaviour

Test title = "Overview " & " " & SELECTEDVALUE('Calendar'[Fiscal year]) & " " & SELECTEDVALUE('Calendar'[Period]) & " " & SELECTEDVALUE('Time intelligence'[Time calculation])

 

  • Current period: All good

riwer_0-1736858300235.png

  • PY: Why last year in title?

riwer_1-1736858407723.png

  • YoY: Error, please help me explain this.

riwer_2-1736858457977.png

Any help understanding the mechanics here would be much appreciated!

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

A title with SELECTEDVALUE('Calculation group'[Calculation item]) will create an text/number conversion error on YoY and YoY%

 

Here is a workaround solution ...

 

  1. First create a slicer visual and use the calculated group item as the slicer value.
  2. Then change the slicer visual to a card visual.
  3. Turn off the card label and adjust the card size, font size and background.
  4. Place the card over the title area of original card visuals and group them together.
  5. They will look exactly like one card with a heading, but is actually two that have been cunningly overlaid.

Please click the [accept solution] and thumbs up buttons. Thank you

View solution in original post

2 REPLIES 2
speedramps
Super User
Super User

A title with SELECTEDVALUE('Calculation group'[Calculation item]) will create an text/number conversion error on YoY and YoY%

 

Here is a workaround solution ...

 

  1. First create a slicer visual and use the calculated group item as the slicer value.
  2. Then change the slicer visual to a card visual.
  3. Turn off the card label and adjust the card size, font size and background.
  4. Place the card over the title area of original card visuals and group them together.
  5. They will look exactly like one card with a heading, but is actually two that have been cunningly overlaid.

Please click the [accept solution] and thumbs up buttons. Thank you

Great workaround, works perfectly for the case!
Still interested however to understand why a title with SELECTEDVALUE('Calculation group'[Calculation item]) genreates a text/number conversion error on YoY and YoY%

 

Running into a similar problem with another measure 

Color main cat = IF(NOT(ISINSCOPE(Account[Sub category])), "Light Gray", "#F5F7F8")

that is used for conditional formatting in a matrix where the same calculation group is used, for the YoY (and YoY%) calculation items.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.