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
DanErickson
Frequent Visitor

Grouping Parameter Fields (I think) for multiple KPI cards

I am building a report that has 10 KPI cards.  I have 4 "groups" of 10 measures each to populate these KPI cards.  Say these are groups A,B,C,D with measures A1, A2, B1, B2, C1, C2, D1, D2, etc...  I would like to be able to display all of the A measures together, but then have a slicer that switches to all of the B measures, all of the C measures, and all of the D measures.  They should go in the correct cards as well, meaning A1, B1, C1, and D1 would all go in the same KPI card.  I have been messing around with Field Parameters, and I think this may be the right approach, but this is a bit more complicated than what I have been able to figure out.  Would love any guidance you all have!

1 ACCEPTED SOLUTION
mh2587
Super User
Super User

Create a table that lists all your measures with corresponding group information.

MeasuresTable = 
DATATABLE(
    "Group", STRING,
    "MeasureName", STRING,
    {
        {"A", "A1"},
        {"A", "A2"},
        {"B", "B1"},
        {"B", "B2"},
        {"C", "C1"},
        {"C", "C2"},
        {"D", "D1"},
        {"D", "D2"}
    }
)

Create a dynamic measure that selects the appropriate measure based on the selected group and measure name.

SelectedMeasure = 
VAR selectedGroup = SELECTEDVALUE(GroupTable[Group])
VAR selectedMeasureName = SELECTEDVALUE(MeasuresTable[MeasureName])
RETURN
    SWITCH(
        TRUE(),
        selectedGroup = "A" && selectedMeasureName = "A1", [A1],
        selectedGroup = "A" && selectedMeasureName = "A2", [A2],
        selectedGroup = "B" && selectedMeasureName = "B1", [B1],
        selectedGroup = "B" && selectedMeasureName = "B2", [B2],
        selectedGroup = "C" && selectedMeasureName = "C1", [C1],
        selectedGroup = "C" && selectedMeasureName = "C2", [C2],
        selectedGroup = "D" && selectedMeasureName = "D1", [D1],
        selectedGroup = "D" && selectedMeasureName = "D2", [D2],
        BLANK()
    )
-- Add slicers for both the GroupTable and the MeasuresTable. This will allow users to select the group and the specific measure within that group.


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

2 REPLIES 2
DanErickson
Frequent Visitor

Thank you!  I sort of simplified my question, so I had to make some modifications to your solution, but the overall technique was exactly what I needed.  Thank you so much for your help.

mh2587
Super User
Super User

Create a table that lists all your measures with corresponding group information.

MeasuresTable = 
DATATABLE(
    "Group", STRING,
    "MeasureName", STRING,
    {
        {"A", "A1"},
        {"A", "A2"},
        {"B", "B1"},
        {"B", "B2"},
        {"C", "C1"},
        {"C", "C2"},
        {"D", "D1"},
        {"D", "D2"}
    }
)

Create a dynamic measure that selects the appropriate measure based on the selected group and measure name.

SelectedMeasure = 
VAR selectedGroup = SELECTEDVALUE(GroupTable[Group])
VAR selectedMeasureName = SELECTEDVALUE(MeasuresTable[MeasureName])
RETURN
    SWITCH(
        TRUE(),
        selectedGroup = "A" && selectedMeasureName = "A1", [A1],
        selectedGroup = "A" && selectedMeasureName = "A2", [A2],
        selectedGroup = "B" && selectedMeasureName = "B1", [B1],
        selectedGroup = "B" && selectedMeasureName = "B2", [B2],
        selectedGroup = "C" && selectedMeasureName = "C1", [C1],
        selectedGroup = "C" && selectedMeasureName = "C2", [C2],
        selectedGroup = "D" && selectedMeasureName = "D1", [D1],
        selectedGroup = "D" && selectedMeasureName = "D2", [D2],
        BLANK()
    )
-- Add slicers for both the GroupTable and the MeasuresTable. This will allow users to select the group and the specific measure within that group.


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.