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

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.

Reply
Kishore_SR
Frequent Visitor

Year Combinations YOY

Hello,

 

I have an Year column with 5 different Years as of now... 2017,2018,2019,2020,2021...

 

So now I need to create all possible Year combinations like 2017 vs 2018, 2017 vs 2019 and so on

Is it possible to create calculated column or measure or any other way

 

Any help would be appreciated... Thank you in Advance!!

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I tried to create a sample pbix file like below, and please check the below picture and the attached pbix file.

It is for creating a new table by using whatever years the data has in the year column.

I hope this sample can provide some ideas on how to create a solution for your dataset.

 

Jihwan_Kim_0-1663139282974.png

 

New Table =
ADDCOLUMNS (
    GENERATE (
        ALL ( Sales[Year] ),
        FILTER (
            SUMMARIZE ( SELECTCOLUMNS ( Sales, "@Year", Sales[Year] ), [@Year] ),
            [@Year] > VAR _currentyear = Sales[Year] RETURN _currentyear
        )
    ),
    "@Newcolumn",
        Sales[Year] & " vs " & [@Year]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim ,

 

Thank you for taking your time and help me out,

 

You have created a seperate table for Year Combo, Can we not create a table and create it inside existing table with Year Column!??

 

If you have any idea on how to do that, please share ...

 

Thank you👍

Hi,

Thank you for your feedback.

Please share your sample pbix file's link (onedrive, googledrive, dropbox, or any other) here, and then I can try to look into it to come up with a more accurate solution that suits your datamodel.

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.