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 simple data set as below.
I want to add a slicer. When I choose a city from this slicer I want Sum of Price Column stay as it is(not filtered) but Total Price for selected City shows data for City A only.
My final goal is to see below visual.
I think I need to create another table for city and leave it not connected and create a measure but couldn't figure it out.
Thanks in advance.
Solved! Go to Solution.
Hi @vsahin,
Here is my solution:
1 - Create a new table with all City names like this:
And use this new table as a slice in the report like this:
After that create this new two measures:
SumPrice = SUM(T_CityData[Price])
NewSumCity =
VAR _City = SELECTEDVALUE('T_CityData Off'[City])
VAR _Result =
CALCULATE(
[SumPrice],
FILTER(
ALL(T_CityData),
T_CityData[City] = _City && T_CityData[Item] = SELECTEDVALUE(T_CityData[Item])
)
)
RETURN
_Result
Build your matrix table like this:
And it should works like you want.
Note: You always need to have one City selected and have only one City selected on the slicer.
Proud to be a Super User!
You're welcome.
Proud to be a Super User!
Hi @vsahin,
Here is my solution:
1 - Create a new table with all City names like this:
And use this new table as a slice in the report like this:
After that create this new two measures:
SumPrice = SUM(T_CityData[Price])
NewSumCity =
VAR _City = SELECTEDVALUE('T_CityData Off'[City])
VAR _Result =
CALCULATE(
[SumPrice],
FILTER(
ALL(T_CityData),
T_CityData[City] = _City && T_CityData[Item] = SELECTEDVALUE(T_CityData[Item])
)
)
RETURN
_Result
Build your matrix table like this:
And it should works like you want.
Note: You always need to have one City selected and have only one City selected on the slicer.
Proud to be a Super User!
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 |
---|---|
86 | |
79 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
82 | |
48 | |
48 | |
48 |