Forum Discussion

riwer's avatar
riwer
Frequent Visitor
1 year ago
Solved

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

  • 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 ...

     

    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

2 Replies

  • 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

    • riwer's avatar
      riwer
      Frequent 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.