Calculation Groups - Selectedvalue/Min/Max

Dear Power BI Users,

currently I’m playing arround with calculation groups to create data labels for my time intelligence calculation items in combination with the new button slicer.
Inspiration: https://www.linkedin.com/feed/update/urn:li:activity:7150448945809240067/

Target:
image

To achieve my target I’m convinced to use a SWITCH statement to detect the current selected calculation item in the beginning (variable).

Issue: Selectedvalue/min/max returns blank if ordinal ist higher than 9

In case of YOY or YOY% there are two min or max values because I’m comparing to different timeframes.

Why are all DAX statements returning blank instead of ordinal number as in all other cases (0-9)?
Is there an alternative approach?

Calculation_Group_Selectedvalue.pbix (1.8 MB)

Thanks in advance for helping :slight_smile:

Christian

Dear all,

may this was a little bit too heavy for my first post :sweat_smile:

In the meantime I was luckily able to solve this complex DAX scenario on my own.

Applied Steps:

Created a disconnected table only for time intelligence data labels

image

Thanks to Amit Chandak (https://www.youtube.com/watch?v=cV5WfaQt6C8)

Changed DAX logic for all calculation items with two comparing timeframes (e.g. YoY, YoY %)

Avoid Bad Practise: Referencing other calculation items, instead repeat both DAX expressions

YoY =
VAR __Actual =
    SELECTEDMEASURE ()
VAR __PY =
    CALCULATE ( SELECTEDMEASURE (), DATEADD ( 'Calendar'[Date], -1, YEAR ) )
VAR __YOY =
    IF ( NOT ISBLANK ( __Actual ) || NOT ISBLANK ( __PY ), __Actual - __PY, BLANK () )
RETURN
    IF (
        SELECTEDMEASURENAME ()
            IN VALUES ( 'Configuration: Calculation Groups - Exclude Measures'[Exclude Measure] ),
        SELECTEDMEASURE (),
        __YOY
    )

Thanks to Esbrina :slight_smile: Power BI & Fabric Summit 2024: Getting started with Calculation Groups in Power BI Desktop

Increased group precedence for calculation group Time Intelligence to highest value in my semantic model

Created a new DAX measure for Time Intelligence data labels and applied it as reference label to the new slicer visual

image

Created a new DAX Measure for virtual filtering of my disconnected data labels table and calculation group Time Intelligence (Cascading Slicer) - used it as visual level filter

Thanks to SQLBI (https://www.sqlbi.com/articles/syncing-slicers-in-power-bi/)

Corrected Formatstring Expression and Expression for calculation items to ignore newly created DAX measures for data labels and cascading slicer

IF (
        SELECTEDMEASURENAME ()
            IN VALUES ( 'Configuration: Calculation Groups - Exclude Measures'[Exclude Measure] ),
        SELECTEDMEASURE (),
        __YOY
    )

Thanks to PeryTus (Youtube)

The final solution - Amazing :star_struck: