Forum Discussion
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")
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
- PY: Why last year in title?
- YoY: Error, please help me explain this.
Any help understanding the mechanics here would be much appreciated!
A title with SELECTEDVALUE('Calculation group'[Calculation item]) will create an text/number conversion error on YoY and YoY%
Here is a workaround solution ...
- First create a slicer visual and use the calculated group item as the slicer value.
- Then change the slicer visual to a card visual.
- Turn off the card label and adjust the card size, font size and background.
- Place the card over the title area of original card visuals and group them together.
- 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
2 Replies
- speedrampsSuper 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 ...
- First create a slicer visual and use the calculated group item as the slicer value.
- Then change the slicer visual to a card visual.
- Turn off the card label and adjust the card size, font size and background.
- Place the card over the title area of original card visuals and group them together.
- 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
- riwerFrequent Visitor
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.