Forum Discussion
Create data group to simplify visual
- 10 months ago
Hi Anonymous ,
Thanks for reaching out to Microsoft Fabric Community Forum.
Organize Your Formulas/Blocks Efficiently with Field ParametersI have tried this repro on my side and got results. Please check it, and if you encounter any issues, let me know.
Created a simple table
Year Sales Budget
2024 100 120
2025 150 130Created Measures Individually
S_2025 = CALCULATE(SUM(Data[Sales]), Data[Year] = 2025)
Var_S_vs_S_1_2025 = [S_2025] - SUM(Data[Budget])
Var_S_vs_S_2_2025 = DIVIDE([S_2025] - SUM(Data[Budget]), SUM(Data[Budget]))These measures serve as the formulas to be grouped.
Created Field ParametersNavigate to Modeling - New Parameter - Fields.
In the dialog box, select the measures to group:
S_2025
Var_S_vs_S_1_2025
Var_S_vs_S_2_2025
Rename the parameter to Measure Groups and Create. Power BI will generate:
A slicer visual featuring your parameter , new DAX table named Measure Groups.
Added Matrix visual.
Add Year to Rows.
Include the Measure Groups field parameter in Values.
This setup allows dynamic grouping and switching between blocks. Maintenance is straightforward, simply update the field parameter when new measures are introduced.
Hello !
Thank you for posting on Microsoft Fabric community.
You need 2 disconnected tables :
Blocks =
DATATABLE(
"Block", STRING, "Order", INTEGER,
{
{"2025", 1},
{"2024 à date", 2},
{"2023 à date", 3},
{"Situation 2025 vs 2024", 4},
{"Situation 2025 vs 2023", 5},
{"Écart vs 2024 final", 6},
{"Écart vs 2023 final", 7}
}
)
Items =
DATATABLE(
"Block", STRING, "Item", STRING, "Order", INTEGER,
{
{"2025","S",1}, {"2025","Var S / S-1",2},
{"2024 à date","S",1}, {"2024 à date","Var S / S-1",2},
{"2023 à date","S",1}, {"2023 à date","Var S / S-1",2},
{"Situation 2025 vs 2024","S",1}, {"Situation 2025 vs 2024","% SWLY",2}, {"Situation 2025 vs 2024","% SWLY S-1",3},
{"Situation 2025 vs 2023","S",1}, {"Situation 2025 vs 2023","% SWLY",2}, {"Situation 2025 vs 2023","% SWLY S-1",3},
{"Écart vs 2024 final","2024 final",1},{"Écart vs 2024 final","% d'atteinte S",2},
{"Écart vs 2023 final","2023 final",1},{"Écart vs 2023 final","% d'atteinte S",2}
}
)
Then you need a measure to map each block and item to it :
Display =
VAR blk = SELECTEDVALUE(Blocks[Block])
VAR it = SELECTEDVALUE(Items[Item])
RETURN
SWITCH ( TRUE(),
blk="2025" && it="S", [S_2025],
blk="2025" && it="Var S / S-1", [Var_S_vs_S_1_2025],
blk="2024 à date" && it="S", [S_YTD_2024],
blk="2024 à date" && it="Var S / S-1", [Var_S_vs_S_1_YTD_2024],
blk="2023 à date" && it="S", [S_YTD_2023],
blk="2023 à date" && it="Var S / S-1", [Var_S_vs_S_1_YTD_2023],
blk="Situation 2025 vs 2024" && it="S", [Delta_2025_vs_2024],
blk="Situation 2025 vs 2024" && it="% SWLY", [%SWLY_2025_vs_2024],
blk="Situation 2025 vs 2024" && it="% SWLY S-1", [%SWLY_S_1_2025_vs_2024],
blk="Situation 2025 vs 2023" && it="S", [Delta_2025_vs_2023],
blk="Situation 2025 vs 2023" && it="% SWLY", [%SWLY_2025_vs_2023],
blk="Situation 2025 vs 2023" && it="% SWLY S-1", [%SWLY_S_1_2025_vs_2023],
blk="Écart vs 2024 final" && it="2024 final", [Final_2024],
blk="Écart vs 2024 final" && it="% d'atteinte S",[Pct_Attainment_vs_2024],
blk="Écart vs 2023 final" && it="2023 final", [Final_2023],
blk="Écart vs 2023 final" && it="% d'atteinte S",[Pct_Attainment_vs_2023],
BLANK()
)