Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am new here and need some help to get a measure that genereates the year choose in a filter for all rows.
Hence when choosing 2022 in the year filter (marked with yellow) I want the measure (2nd coumn) to write 2022 for all rows in the table below. When choosing 2023 I want it to write 2023 for all rows.
Help would be super appreaciated:)
Thanks!
Solved! Go to Solution.
Hi, @jwulcan
According to your description, you seem just need to get the data from the slicer "Year".
I think you can try to use the MAX() or selectedvalue() function in it.
MAX('Slicer table'[Year]) or SELECTEDVALUE('Slicer table'[Year])
The 'Slicer table'[Year] is the field you put in the slicer.
Because your slicer selects the corresponding year, then my current filter context is this year, and this year should be returned in all cases.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
hi @jwulcan
what do you mean by "to write 2022 for all rows in the table below"?
To exlain a little bit further. I want to use this Measure for a Switch measure. So if 2022 is chosen as "year" I want a formula to generate 2022 (as requested in my post above). Then I will use this for a Switch formula with different calculations depending on if the year choosen is 2021, 2022 or 2023.
Thanks!
I want to have a formula that returns 2022 for all rows if I have selected 2022 in the year filter. Hence for row with 202101 i want the formula to return 2022, for 202102 return 2022 etc. If I change the year filter to 2023 I want the fomula to write 2023 for all rows. Makes sense?
Kind regards,
Johannes
Hi, @jwulcan
According to your description, you seem just need to get the data from the slicer "Year".
I think you can try to use the MAX() or selectedvalue() function in it.
MAX('Slicer table'[Year]) or SELECTEDVALUE('Slicer table'[Year])
The 'Slicer table'[Year] is the field you put in the slicer.
Because your slicer selects the corresponding year, then my current filter context is this year, and this year should be returned in all cases.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |