Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi All,
I have a urgent requirement in which I have created the two measures.
Projectvalue= Sum(projectvalue)
Forecast= Sum(forecast)
Now i want to plot a bar chart with projectvalue, forecast and both. I have created a table named as Measure having three rows(Projectvalue, Forecast, Both)
I have created the selected measure for forecast and project value and it working perfecting fine. What to do if I need to showcase both the measure using the Both in the slicer.
Solved! Go to Solution.
Hi, @niteshtrehan89
According to your description, you want to display the sum of values according to the selection of Slicer, you can try my steps:
Sum of Project Value =
SWITCH(
SELECTEDVALUE(Slicer[Name]),
"Project Value",SUM('Measure'[Project Value]),
"Forecasted Project Value",BLANK(),
"Both",SUM('Measure'[Project Value]))
Sum of Forecasted Project Value =
SWITCH(
SELECTEDVALUE(Slicer[Name]),
"Project Value",BLANK(),
"Forecasted Project Value",SUM('Measure'[Forecasted Project Value]),
"Both",SUM('Measure'[Forecasted Project Value]))
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @niteshtrehan89
According to your description, you want to display the sum of values according to the selection of Slicer, you can try my steps:
Sum of Project Value =
SWITCH(
SELECTEDVALUE(Slicer[Name]),
"Project Value",SUM('Measure'[Project Value]),
"Forecasted Project Value",BLANK(),
"Both",SUM('Measure'[Project Value]))
Sum of Forecasted Project Value =
SWITCH(
SELECTEDVALUE(Slicer[Name]),
"Project Value",BLANK(),
"Forecasted Project Value",SUM('Measure'[Forecasted Project Value]),
"Both",SUM('Measure'[Forecasted Project Value]))
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@niteshtrehan89 , measure slicer is the measure itself so only measure can be there.
So both measures need to check the value of slicer
example
Projectvalue =
var _flag = countx(allselected(Measure), 'Measure'[Measure] in {"Project Value","Both"})+0
return
if(_flag>0, sum(data[Project Value]), blank())
Forecast =
var _flag = countx(allselected(Measure), 'Measure'[Measure] in {"Forecasted Project Value","Both"})+0
return
if(_flag>0, sum(data[Forecasted Project Value]), blank())
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
78 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |