Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone!
I am currently working in a project where I have several columns called:
XX - Y0
XX - Y-1
XX - Y-2
XX - Y-3
XY - Y0
XY - Y-1
XY - Y-2
XY - Y-3
I am currently using those columns to make line charts, however when plotting them in the legend the title of the series are "XX - Y0", "XX - Y-1", etc, as expected, and what I would like to see is that when the series title contains Y0 = then to display current year (in this case "2024"), and when the series title contains Y-1, to display "2023 (2024-1)", etc. So next year, the Y0 series will have 2025 as a title and Y-1 will have 2024.
Is this something feasable? I have so far tried to create some measures, but I am not able to see where to place them in order to change my chart.
I would appreicate any tips! Thanks a lot,
Laura.
Solved! Go to Solution.
Hi @lgo ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Column =
VAR _year =
YEAR ( 'Data-Table (2)'[Date] )
RETURN
SWITCH (
'Data-Table (2)'[DYear],
"Y0", _year,
"Y1", _year - 1,
"Y-1", _year - 1,
"Y2", _year - 2,
"Y-2", _year - 2
)
Best Regards
https://drive.google.com/file/d/1dXGEQ3DTDon9IogYDLYQTRUgPSRfMXb0/view?usp=sharing , are you able to see it? thanks a lot! (i have also been trying to keep the date as "MMM" format (whithout the year), but i believe that is something that cannot be done)
Hi @lgo ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Column =
VAR _year =
YEAR ( 'Data-Table (2)'[Date] )
RETURN
SWITCH (
'Data-Table (2)'[DYear],
"Y0", _year,
"Y1", _year - 1,
"Y-1", _year - 1,
"Y2", _year - 2,
"Y-2", _year - 2
)
Best Regards
Hi,
Can you share a pbix file with one example? I can try to help you.
Proud to be a Super User!
User | Count |
---|---|
101 | |
90 | |
80 | |
71 | |
71 |
User | Count |
---|---|
114 | |
98 | |
97 | |
73 | |
72 |