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
Hi,
I have piechart, containing several values calculated from Columns and measures.
I wish to select a category in the chart and been able to display its value in a card.
Depending on the category I choose, the card should show the value selected in the chart.
If nothing is selecting, the total is displayed.
is it possible to do it in PBI?
regards
Solved! Go to Solution.
Ok, eventually I figured it out.
1. I created a new table containing the name of the measures I want to display.
Table2 = {("Measure1 name",1),("Measure2 name",2)}
2. I created a new measure that switches the between column or measure
Total =IFERROR(VALUES([Table2]),""),"Measure1 name",SUM([Measure1]),"Measure2 name",SUM([Measure2]),[ALL])
it works for me from a pie chart to a card. try having a look at the queries generated. open Performance Analyzer and start recording, click on one of the categories in your pie chart and then copy the query generated for the card visual. paste that into DAX Studio and see what filters are being applied
I think the problem is that my piechart contains several different values (measures) instead of one with several legends.
Indeed the second solution would have worked as you suggested.
the main problem is if it is possible with DAX to acknowledge when a measure is selected /filtered.
I tried Isfiltered and iscrossfiltered, but it does not recognize when selected.
I think the output from Performance Analyzer might still help. If you compare the queries with nothing selected and with a value selected that should show you the difference. If there is no difference then no filter is being applied and you have no hope of detecting anything, you would need to rethink how you're approaching the problem. If there is a difference, and a filter is being applied, then it should be possible to examine whatever the filter is being applied to and determine whether or not it is being filtered.
One possible method for detecting a filter on a measure might be something like
Measure is filtered =
var currentValue = [Measure]
var totalValue = CALCULATE([Measure], ALL() )
return currentValue <> totalValue
Thanks for your comment.
I am not sure I understood your formula.
Basically, what I should do is to use SWITCH formula, so that when a specific measure is highlighted in the piechart, it switches to that measure.
Now, how can DAX acknowledge I highlighted a given measure in the chart?
FYI, I ran the analyzer when highlighting a given measure in the chart.
The first step is "Cross-highlighted", I need to understand how to read that in DAX.
Any idea?
In Performance Analyzer you would need to expand the entry for the card you're interested in. When you click on an item in the Performance Analyzer pane it will highlight it in the main report section so you can tell which card you have selected. Then just copy the code and examine it in DAX Studio
I do not have DAX Studio. I would have to ask my IT to install it eventually.
for now I found this page explaining how to create a measure that switches from a set of other measures, by clicking on a filter.
what I need to figure out, is if I can do with highlighting in a chart instead of a slicer.
Not sure field parameters would work in this particular case, but they're a really useful addition to Power BI.
You don't necessarily need DAX Studio to look at the code, any text editor will do, though it is a handy tool to have. The key thing to look for is any table filters created before the main query.
Ok, eventually I figured it out.
1. I created a new table containing the name of the measures I want to display.
Table2 = {("Measure1 name",1),("Measure2 name",2)}
2. I created a new measure that switches the between column or measure
Total =IFERROR(VALUES([Table2]),""),"Measure1 name",SUM([Measure1]),"Measure2 name",SUM([Measure2]),[ALL])
That is the default behaviour, when you make a selection in one visual on a page that selection will filter all the other visuals on that page.
If you put the same measure which you are using in the pie chart onto a card visual, selecting a category in the pie chart will filter the card visual to only show values for that category.
Nope, from a chart to another chart or a matrix/Card it does not.
From a Matrix to a chart/card, indeed it works.
... and edit interactions are set correctly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |