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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
GijsBI
Frequent Visitor

Select a subset of measures for each visual based on field parameter

Hi, 

 

I have defined a field parameter containing multiple measures that are grouped into multiple categories. When I select a category, I would like to display some of the measures in visual X and some other measures (within the same group) in visual Y. Is it possible to show only a subset of measures in a visual when selecting a field parameter group? If yes, how could I approach this?

 

Thanks in advance. 

 

EDIT: I've added some dummy data to make my question more clear.

 

I created a field parameter group where I select group 1. When this group is selected, both Graph 1 and Graph 2 display the measures that are in this group. I want to know if it is possible to show a subset of measures in Graph 1 and another subset in Graph 2.

 

 Field parameter used to show measures in Graph 1/2Field parameter used to show measures in Graph 1/2

Graph 1 showing 3 measuresGraph 1 showing 3 measures

Graph 2 showing the exact same measuresGraph 2 showing the exact same measures

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @GijsBI ,

 

Option 1, create another field parameter so you can manually control the fields displayed in both graphs.

vcgaomsft_0-1739930531252.png
Option 2: Create an enter table and measures similar to the following to control the output based on selected field parameters.

vcgaomsft_2-1739932324293.png

Measure = 
VAR __curr_measure_name = SELECTEDVALUE('Table'[MeasureName])
VAR __curr_product = SELECTEDVALUE('financials'[Product])
VAR __selected_group = ALLSELECTED('Parameter'[Group])
VAR __measure_names = CALCULATETABLE(VALUES('Table'[MeasureName]),NOT 'Table'[Group] IN __selected_group)
VAR __result = 
IF( 
    __curr_measure_name IN __measure_names, 
    SWITCH( 
        __measure_names,
        "Avg_Price", [Avg_Price],
        "Sold_Amount", [Sold_Amount],
        "Total_Profit", [Total_Profit],
        "Total_Sales", [Total_Sales]
    )
)
RETURN
    __result

vcgaomsft_1-1739932175122.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

6 REPLIES 6
v-cgao-msft
Community Support
Community Support

Hi @GijsBI ,

 

Option 1, create another field parameter so you can manually control the fields displayed in both graphs.

vcgaomsft_0-1739930531252.png
Option 2: Create an enter table and measures similar to the following to control the output based on selected field parameters.

vcgaomsft_2-1739932324293.png

Measure = 
VAR __curr_measure_name = SELECTEDVALUE('Table'[MeasureName])
VAR __curr_product = SELECTEDVALUE('financials'[Product])
VAR __selected_group = ALLSELECTED('Parameter'[Group])
VAR __measure_names = CALCULATETABLE(VALUES('Table'[MeasureName]),NOT 'Table'[Group] IN __selected_group)
VAR __result = 
IF( 
    __curr_measure_name IN __measure_names, 
    SWITCH( 
        __measure_names,
        "Avg_Price", [Avg_Price],
        "Sold_Amount", [Sold_Amount],
        "Total_Profit", [Total_Profit],
        "Total_Sales", [Total_Sales]
    )
)
RETURN
    __result

vcgaomsft_1-1739932175122.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Thanks a lot for the detailed explaination. Have a great day!

miTutorials
Super User
Super User

You can achieve this by using a calculated column in your field parameter table and applying visual-level filters to show only the relevant fields in each visual.

 

Visual Filter = 
SWITCH(
    'Parameter'[Parameter], 
    "Total Sales", "Visual 1",
    "Total Qty", "Visual 1",
    "Returns", "Visual 2"
)

 

Best Regards,

Ismail
🎥 Check out my YouTube Channel for Power BI tips & tutorials!
🔗 MiTutorials - Power BI Learning Hub

miTutorials
Super User
Super User

Would you be able to share PBIX file to look into this ?

I've added some dummy data images to the post, hopefully this helps.

Hi, 

 

Unfortunately not, since it's business related data that can't be anonymized easily. 

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors