Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
99 | |
96 | |
38 | |
36 |
User | Count |
---|---|
151 | |
125 | |
75 | |
74 | |
53 |