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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.