Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 months ago
Solved

Create data group to simplify visual

Hi everyone, 

 

I would like to organize some formulas in a matrice because it's difficult to analyse this one with many field. 

Is it possible to regroup like a "bloc" different formulas ? 

Here this is my example : 

 

 

Thank you in advance, 

 

 

 

  • Hi Anonymous ,
    Thanks for reaching out to Microsoft Fabric Community Forum.
    Organize Your Formulas/Blocks Efficiently with Field Parameters

    I 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 130

    Created 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 Parameters

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

4 Replies

  • v-sshirivolu's avatar
    v-sshirivolu
    Community Support

    Hi Anonymous ,
    Thanks for reaching out to Microsoft Fabric Community Forum.
    Organize Your Formulas/Blocks Efficiently with Field Parameters

    I 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 130

    Created 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 Parameters

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

    • v-sshirivolu's avatar
      v-sshirivolu
      Community Support

      Hi Anonymous ,

      I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.

       

      • v-sshirivolu's avatar
        v-sshirivolu
        Community Support

        Hi Anonymous ,

        I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you

         

  • 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()
    )