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
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!
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 |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |