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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
newgirl
Post Patron
Post Patron

Show detail labels even if more than one field parameter value is selected

Hi!

 

I have this sample data table. The numbers under Steps 1 to 3 show the number of minutes of that step.

DateStep 1Step 2Step 3
1/1/20241520
2/1/2024789
3/15/2024101112

 

I created a SUM measure for each Step and then created a field parameter using those 3 steps.

My goal is to show in a line chart the no. of minutes based on the selected Step from the field parameter.

 

So it works fine and I decided to add detail label that shows the % variance from previous month using the measures below:

 

SELECTED = 
VAR __SelectedValue =
    SELECTCOLUMNS (
        SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ),
        Parameter[Parameter]
    )
RETURN IF ( COUNTROWS ( __SelectedValue ) = 1, __SelectedValue )
Previous Month Value = 
VAR SelectedMeasure = [SELECTED]
RETURN
    SWITCH(
        TRUE(),
        SelectedMeasure = "Step 1m", CALCULATE([Step 1m], PREVIOUSMONTH('Calendar'[Date])),
        SelectedMeasure = "Step 2m", CALCULATE([Step 2m], PREVIOUSMONTH('Calendar'[Date])),
        SelectedMeasure = "Step 3m", CALCULATE([Step 3m], PREVIOUSMONTH('Calendar'[Date])),
        BLANK()
    )

 

 

 

MoM Difference = 
VAR SelectedMeasure = [SELECTED]
RETURN
    SWITCH(
        TRUE(),
        SelectedMeasure = "Step 1m", IF([Previous Month Value]=0,BLANK(),FORMAT(DIVIDE([Step 1m],[Previous Month Value])-1,"0.0%")),
        SelectedMeasure = "Step 2m", IF([Previous Month Value]=0,BLANK(),FORMAT(DIVIDE([Step 2m],[Previous Month Value])-1,"0.0%")),
        SelectedMeasure = "Step 3m", IF([Previous Month Value]=0,BLANK(),FORMAT(DIVIDE([Step 3m],[Previous Month Value])-1,"0.0%")),
        BLANK()
    )

 

 

Initially, I was using SELECTEDVALUE() but I kept getting an error: "There's an error that showed: Calculator error in measure "[MoM Difference]". Column [Parameter] is part of composite key, but not all columns of the composite key are included in the expression or its dependent expression."

I then found this article in which it says to use the measure below:

 

VAR __SelectedValue =
    SELECTCOLUMNS (
        SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ),
        Parameter[Parameter]
    )
RETURN IF ( COUNTROWS ( __SelectedValue ) = 1, __SelectedValue )

 

 

The problem is that now, it would only show the % variance if the reader selects only ONE from the field parameter slicer since the condition in the new measure looks only if the counted rows =1 . How to keep showing the % variance regardless of the no. of selected field parameters?

Here's my sample file

 

When 1 is selected:

field1.PNG

 

When more than 1 is selected (doesn't appear anymore).

field2.PNG

1 REPLY 1
DataInsights
Super User
Super User

@newgirl,

 

You could unpivot the Step columns in Power Query (Transform --> Unpivot Columns), resulting in the following:

 

DataInsights_0-1725463043295.png

 

This should enable you to use the new Step column in a slicer instead of a field parameter.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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