Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |