Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
lgo
Frequent Visitor

Change Title of Series to have it different than column name but depend on it

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.

 

1 ACCEPTED SOLUTION

Hi @lgo ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Unpivot and split the columnsUnpivot and split the columns

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
    )

Create calculated column and line chartCreate calculated column and line chart

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
lgo
Frequent Visitor

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.

Unpivot and split the columnsUnpivot and split the columns

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
    )

Create calculated column and line chartCreate calculated column and line chart

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
_AAndrade
Super User
Super User

Hi,

Can you share a pbix file with one example? I can try to help you.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.