March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a situation where users want the ability to have a column change the data presented based on a slicer selection. The analogy would be:
In this example, the users have a table of sales data (from table A), but the first column can be either a buyer name (from table B) or a seller name (from table C) with the other columns being the sum for either the buyer or seller shown in the current row. Table A is linked to B and C. I've tried several different approaches (particularly with a standalone table with "Buyer" and "Seller" for the slicer and a measure that gives the current selection), but it seems like DAX functions within calculated columns can't detect filter changes. Any thoughts on how to do this?
Solved! Go to Solution.
Hi @rjstreet
A couple of ideas that you can experiment with:
(PBIX file demonstrating these uploaded here)
Sales Amount = SWITCH ( [BuyerSeller Selected], "Buyer", SUM ( Model2_Sales[Sales] ), "Seller", CALCULATE ( SUM ( Model2_Sales[Sales] ), ALL ( Model2_Buyer ), USERELATIONSHIP ( Model2_Sales[BuyerSeller], Model2_Seller[Seller] ) ) )
Anyway, these are just ideas - see if they are of any use.
Owen 🙂
I had to solve this problem myself with a list of 42 columns where I needed to have a single page to plot the sales per day, the items sold per day, the complaints per day etc... the comon dimension was the date but the Y azis had to change from column A to columns B etc.
Since it took me a while to make it happen, I desided to post an example with a dummy sales dataset here. I hope it helps anyone that might face the same issue.
Hi @rjstreet
A couple of ideas that you can experiment with:
(PBIX file demonstrating these uploaded here)
Sales Amount = SWITCH ( [BuyerSeller Selected], "Buyer", SUM ( Model2_Sales[Sales] ), "Seller", CALCULATE ( SUM ( Model2_Sales[Sales] ), ALL ( Model2_Buyer ), USERELATIONSHIP ( Model2_Sales[BuyerSeller], Model2_Seller[Seller] ) ) )
Anyway, these are just ideas - see if they are of any use.
Owen 🙂
Hi @OwenAuger I m trying to implement this solution in to my problem but can't help my self.
I have two tables Dimensions and Fact.
Dimension Table:
ID | Name | Job Title | Country |
1001 | A | Manager | USA |
1002 | B | Manager | Canada |
1003 | C | Manager | USA |
1004 | D | CEO | Sout Africa |
1005 | E | CEO | China |
1006 | F | Assistant | Canada |
1007 | G | Assistant | India |
1008 | H | Manager | Canada |
1009 | I | CEO | Canada |
1010 | J | Manager | China |
Fact Table:
ID | Name | Expenses | Day |
1001 | A | 19555 | day 1 |
1002 | B | 68287 | day 1 |
1003 | C | 89763 | day 1 |
1001 | A | 45877 | day 2 |
1005 | E | 69871 | day 2 |
1001 | A | 36533 | day 3 |
1007 | G | 62252 | day 2 |
1008 | H | 24095 | day 2 |
1009 | I | 80338 | day 2 |
1008 | H | 15994 | day 1 |
Slicer Table:
Country, Job Title, N...
When i select Country, the chart should shows
but if i switch to Job title in slicer, the chart will show
Note:
Thanks,
Kulchandra
did you find the solution, please share if you did. i am also facing the same problem
Hello.
I'm trying to use slicer like a parameter, if a click two times at same slicer item I uncheck the item.
for example, slicer with 2 itens, if I click on item A, only data from item A will show, if I click on item A again, all data will show.
Any Idea?
Hey @OwenAuger
I downloaded the file you sent, but I can't seem to figure out how does this work? You only use columns from the Model1_Sales table and the table below still changes depending on the slicer filter selected. Can you please explain this to me? I really need to implement this in my report.
Thanks
Hi @Anonymous
Go to Relationships view and it should be clearer.
The BuyerSeller column of the Model1_Sales table is related to the Name column of the BuyerSeller table.
The BuyerSeller table also contains a column Type which indicates whether the current rows is a Buer or Seller. I used this in a slicer to switch between Buyers & Sellers.
Owen 🙂
We're using the first option - it's a bit clunky conceptually, but gives the appropriate responses nicely!
Alternatively, being able to swap out the visual based on a slicer selection would work as well (though we don't seem to have a way to do this currently).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
84 | |
66 | |
54 | |
43 |
User | Count |
---|---|
203 | |
106 | |
98 | |
65 | |
56 |