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.
Hello all,
the following scenario is needed:
In my report i used the Measure A to be able to shown a measure when a user click on the slicer. But in this Measure A there is 2different measures that are filtered from two different columns.
The [Growth last month] is using the column Occupation[Month]
The [sacked last month] is using column Occupation[NextMonth]
Because of this two different columns for filtering some of my Power BI charts are not filtered.
So i though i add use a IF Then else statement in Measure A to say:
If the [Growth last month] are clicked in the slicer then a bar chart need to shown data based on the Occupation[Month]
and if the [sacked last month] then a bar chart need to shown data from Occupation[NextMonth]
Measure A =
SWITCH( TRUE(),
VALUES('Fact Growth'[Growth Fact]) = "Growth in employees last month",'Fact Growth'[Growth last month],
VALUES('Fact Growth'[Growth Fact]) = "Total employees sacked last month ",'Fact Growth'[sacked last month],
BLANK()
)
Any suggestion how i can improve/change the Measure A to add the if condition based on the two columns of Occupation tables?
Many thanks!
bar chart
slicer object with two measures
Occupation[Month] filter in bar chart
@rsanyoto , Try like
Measure A =
SWITCH( TRUE(),
max('Fact Growth'[Growth Fact]) = "Growth in employees last month",'Fact Growth'[Growth last month],
max('Fact Growth'[Growth Fact]) = "Total employees sacked last month ",'Fact Growth'[sacked last month],
BLANK()
)
or
Measure A =
sumx(values('Fact Growth'[Growth Fact]),
SWITCH( TRUE(),
max('Fact Growth'[Growth Fact]) = "Growth in employees last month",'Fact Growth'[Growth last month],
max('Fact Growth'[Growth Fact]) = "Total employees sacked last month ",'Fact Growth'[sacked last month],
BLANK()
))
hI @amitchandak ,
Thanks for your quick response. I have tested both of your proposals but the Bar chart that use the Measure A dont filter the right data.
fyi: this barchart uses has a default filter based on Occupation[Month].
My question to you is: is it right to keep this default filter on this barchart to let your proposals works? or should i delete Occupation[Month] on the filter visual?
Because the goal of the measure A needs is need to be "flexible" by showing the right data when a user click on one of the measure in the slicer visual.
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 |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |