Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Dear PowerBI community, I have an headscratcher that is driving me nuts.
Initial disclaimer: I am working with a "long" table (I do not like it but it was due to external constraints). This info will come handy later.
Basically I have 2 graphs in the same page.
The "left" graph is a 100% stacked bar chart showing 1 measure (a count) over "Year", with another dimension in legend (yes,no,no data).
The "right" graph is a Pie chart, showing "technically the same measure" with the same legend.
The difference between the two is the "filters on this visual" (since I am working with a long table, I am using the same measure and applying different "filters on this visual" from the filter pane to differentiate the two.
So far so good. Now, since it makes no sense to show this measure over multiple years, in the "right" Pie chart I have to only display one year at a time maximum. I had already created previously a measure called "SelectedYear" which gets the maximum year possible (selected or otherwise) and used it somewhere else without any issues. So - for this PieChart - I basically created a second measure, which is = to the 1st one + it has FILTER(FactTable, FactTable[Year] = [SelectedYear]).
Now my problem is the following. If I filter both graphs from a "Year" slicer - everything works as expected.
If, instead, I filter the "right" PieChart by selecting the year from the "left" stacked bar chart, the Pie Chart goes to 0.
Although, as you can see from the screenshots below, the dynamic title of the PieChart correctly displays 2021 (the SelectedYear value) and the "applied filters" only show Year = 2021.
I have no clue what is happening here 🙁
Thank you for any replies
[EDIT]: I am dumb. The first graph is actually also filtering on the "filters applied on this visual" (it is just that I had hidden the filter so it is not showing in the filters applied. Still, any workarounds to that? Also, I do not want to "edit interactions" because I'd still want the "Year" filter to be carried over from the left barchart to the piechart.
@ESAL_WHO , Ideally you should have connected/joined year/Date table, so no need for filter.
Or try a filter like
FILTER(FactTable, FactTable[Year] in Values( Date[Year]))
If year is selected from Fact, I do not this you need this filter
Calendar and FactTable are indeed connected and the "Year" is filtering both BarChart and PieCHart.
The problem is that if I filter from the BarChart, also the "filter on this visual" is carried over to the "PieChart" and it creates a blank set. (I've just added a screenshot of what happens in the original post)
User | Count |
---|---|
115 | |
94 | |
87 | |
76 | |
65 |
User | Count |
---|---|
138 | |
112 | |
109 | |
98 | |
93 |