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 need to write a measure that will be calculated on the chart only for the smaller of the selected years. That is, if I select 2023 and 2024 on the slicer, I only want to see the value for 2023 (i.e. one bar) on the chart. On the X axis there will still be 2023 and 2024 because they are needed for other measures. That is, I need remove one right, blue bar (gray is another measure that counts well).
Thanks!
Solved! Go to Solution.
yes you are right. The issue was due to an oversight on my part. you should write it as follows...
var min_year = calculate( min ('date' [year]) , allselected ('date' [year]))
Hi @Lukas90
I have a half solution that works, but will keep all the years on the x axis visible at all times:
SelectiveVis table has a Year column and two measures (Correct and Wrong, correct is the one you want to show on all years, wrong is the one you want to show only on the min year) based on 2 columns
I create a separate table (yrhlp) that only has one year column.
Then a third measure:
Then configure relationship as follows:
In your visual, use the year from SelectiveVis as the axis, but in your slicer use the year from yrhlp.
Here is how it looks:
Couldnt find a way to get rid of the blank 2022 column unfortunately. But in terms of showing the measure only on the min year, it does what you were after.
Hope it helps a little!
Proud to be a Super User! | |
so you should write it as follows:
var min_year = calculate( min ('date' [year]) , allselected ('date' , 'date' [year]))
If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
Still doesn't work:(
I removed table reference and now it works! Many Thanks!
Yes, for this second option I got "Multiple arguments are not allowed in the ALLSELECTED function when the first argument is a table reference."
yes you are right. The issue was due to an oversight on my part. you should write it as follows...
var min_year = calculate( min ('date' [year]) , allselected ('date' [year]))
Hi @Lukas90
you can update your measure as follows:
measure _min :=
var min_year = min ('date' [year]) (if you dont have dim date you should use all or allselected)
return
if (selectedvalue(year) = min_year , blue_measure , 0 )
If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
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 |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |