Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |