Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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.
Solved! Go to Solution.
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”
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.
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
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”
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.
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
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.
@Ritaf1983 , Thank you.
Is there any way that we can do this without repetitively creating the same measures? Looking for some optimal solution.
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....
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |