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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Arul
Super User
Super User

Hide Visual Metrics based on Config file

Hi all,

I have config file which is having below data,

 

ID Metric Name Flag Visual
1 Sales 1 V1
2 Profit 1 V1
3 Gross Sales 1 V1
4 Sales 0 V2
5 Profit 1 V2
6 Gross Sales 1 V2

 

I have below visuals in Power BI, My requirement is to hide certain metrics in visual 1 but to show the same metrics in visual 2 based on the config file. Could anyone have any idea to achieve this? I am doing it based on measures right now.

Arul_0-1730992682141.png

@amitchandak @Pragati11 





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

Proud to be a Super User!


LinkedIn


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Arul 

 

Thank you very much Ritaf1983 for your prompt reply. Let me share a few things here.

 

Here I assume that your sales sheet looks like this:

 

“Sales”

vnuocmsft_0-1731033833531.png

 

vnuocmsft_1-1731034038334.png

 

Based on the data you provide, I recommend that you create measures for both visual objects separately.

 

 

Measure V1 = 
CALCULATE(
    SUM('Sales'[Value]),
    FILTER(
        'Config',
        'Config'[Visual] = "V1"
        &&
        'Config'[Metric Name] = SELECTEDVALUE('Sales'[Name])
        &&
        'Config'[Flag] <> 0
        ))

 

 

 

Measure V2 = 
CALCULATE(
    SUM('Sales'[Value]),
    FILTER(
        'Config',
        'Config'[Visual] = "V2"
        &&
        'Config'[Metric Name] = SELECTEDVALUE('Sales'[Name])
        &&
        'Config'[Flag] <> 0
        ))

 

 

Here is the result.

 

vnuocmsft_2-1731034073660.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Arul 

 

Thank you very much Ritaf1983 for your prompt reply. Let me share a few things here.

 

Here I assume that your sales sheet looks like this:

 

“Sales”

vnuocmsft_0-1731033833531.png

 

vnuocmsft_1-1731034038334.png

 

Based on the data you provide, I recommend that you create measures for both visual objects separately.

 

 

Measure V1 = 
CALCULATE(
    SUM('Sales'[Value]),
    FILTER(
        'Config',
        'Config'[Visual] = "V1"
        &&
        'Config'[Metric Name] = SELECTEDVALUE('Sales'[Name])
        &&
        'Config'[Flag] <> 0
        ))

 

 

 

Measure V2 = 
CALCULATE(
    SUM('Sales'[Value]),
    FILTER(
        'Config',
        'Config'[Visual] = "V2"
        &&
        'Config'[Metric Name] = SELECTEDVALUE('Sales'[Name])
        &&
        'Config'[Flag] <> 0
        ))

 

 

Here is the result.

 

vnuocmsft_2-1731034073660.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ritaf1983
Super User
Super User

Hi @Arul 

If I understood correctly, the table you shared has flags indicating whether a metric should be shown or hidden in each visual. To achieve your requirement, you'll need to create separate measures for each visual, using the flags in the config file to determine which metrics to display.

Since the Power BI engine doesn’t inherently know which visual it's dealing with, there’s no direct way to toggle visibility of metrics based on visuals. Instead, you can set up specific measures that check the flags for each visual and display only the relevant metrics.

For example:

1. Create a measure for Visual 1 that only includes metrics where the flag is 1 for V1.
2. Create a measure for Visual 2 that includes metrics based on the flag for V2.
Each measure will reference the appropriate flags and determine which data to display, ensuring that Visual 1 and Visual 2 show the intended metrics.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

@Ritaf1983 , Thank you.

Is there any way that we can do this without repetitively creating the same measures? Looking for some optimal solution.





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

Proud to be a Super User!


LinkedIn


Anonymous
Not applicable

Hi @Arul 

 

It would be difficult to do this without creating multiple measures.

 

I suggest you create different measures for different visuals.

 

If you find another way, look forward to your sharing!

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Arul 
Check the solution that @Anonymous suggested....

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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