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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
singh_gagan03
Frequent Visitor

Please help in forming the below table structure in PowerBI

Hi All, 

 

I have a table structure which is:

singh_gagan03_0-1594103889828.png

And I want to convert it into the below sample shown:

singh_gagan03_1-1594103957334.png

Why I am trying to achieve the above feat is that I want to map all the possible years and years-period to the corresponding years and years- period except itself. Further allocating the previous year as the last year (in this case 2019) and the years-period as "FY Actuals". Above thing, I tried to achieve by "CROSS JOIN" but it takes a whole lot of time to get executed.

 

But Once I achieved it then again I did a "CROSS JOIN" to get the mapping of period and quarters.

 

After that, for example, if the period lets say CC is 202006 then the P01-P05 should be "YTD" and rest as "YTG". But if it is "FY Actuals" flag for P01-P13 should be "YTG".

 

I am attaching the excel sheet for a better understanding of the user. Please let me know if further explanation is required.

CCCC YearLCLC YearLast Year CycleLast YearQuarterPeriodTime Indicator
20200520202020062020FY Actuals2019Q1P01YTD
20200520202020062020FY Actuals2019Q1P02YTD
20200520202020062020FY Actuals2019Q1P03YTD
20200520202020062020FY Actuals2019Q2P04YTD
20200520202020062020FY Actuals2019Q2P05YTD
20200520202020062020FY Actuals2019Q2P06YTG
20200520202020062020FY Actuals2019Q3P07YTG
20200520202020062020FY Actuals2019Q3P08YTG
20200520202020062020FY Actuals2019Q3P09YTG
20200520202020062020FY Actuals2019Q4P10YTG
20200520202020062020FY Actuals2019Q4P11YTG
20200520202020062020FY Actuals2019Q4P12YTG
20200520202020062020FY Actuals2019Q4P13YTG
2020052020FY Actuals2019FY Actuals2019Q1P01YTD
2020052020FY Actuals2019FY Actuals2019Q1P02YTD
2020052020FY Actuals2019FY Actuals2019Q1P03YTD
2020052020FY Actuals2019FY Actuals2019Q2P04YTD
2020052020FY Actuals2019FY Actuals2019Q2P05YTD
2020052020FY Actuals2019FY Actuals2019Q2P06YTG
2020052020FY Actuals2019FY Actuals2019Q3P07YTG
2020052020FY Actuals2019FY Actuals2019Q3P08YTG
2020052020FY Actuals2019FY Actuals2019Q3P09YTG
2020052020FY Actuals2019FY Actuals2019Q4P10YTG
2020052020FY Actuals2019FY Actuals2019Q4P11YTG
2020052020FY Actuals2019FY Actuals2019Q4P12YTG
2020052020FY Actuals2019FY Actuals2019Q4P13YTG
20200620202020052020FY Actuals2019Q1P01YTD
20200620202020052020FY Actuals2019Q1P02YTD
20200620202020052020FY Actuals2019Q1P03YTD
20200620202020052020FY Actuals2019Q2P04YTD
20200620202020052020FY Actuals2019Q2P05YTD
20200620202020052020FY Actuals2019Q2P06YTD
20200620202020052020FY Actuals2019Q3P07YTG
20200620202020052020FY Actuals2019Q3P08YTG
20200620202020052020FY Actuals2019Q3P09YTG
20200620202020052020FY Actuals2019Q4P10YTG
20200620202020052020FY Actuals2019Q4P11YTG
20200620202020052020FY Actuals2019Q4P12YTG
20200620202020052020FY Actuals2019Q4P13YTG
2020062020FY Actuals2019FY Actuals2019Q1P01YTD
2020062020FY Actuals2019FY Actuals2019Q1P02YTD
2020062020FY Actuals2019FY Actuals2019Q1P03YTD
2020062020FY Actuals2019FY Actuals2019Q2P04YTD
2020062020FY Actuals2019FY Actuals2019Q2P05YTD
2020062020FY Actuals2019FY Actuals2019Q2P06YTD
2020062020FY Actuals2019FY Actuals2019Q3P07YTG
2020062020FY Actuals2019FY Actuals2019Q3P08YTG
2020062020FY Actuals2019FY Actuals2019Q3P09YTG
2020062020FY Actuals2019FY Actuals2019Q4P10YTG
2020062020FY Actuals2019FY Actuals2019Q4P11YTG
2020062020FY Actuals2019FY Actuals2019Q4P12YTG
2020062020FY Actuals2019FY Actuals2019Q4P13YTG
FY Actuals20192020052020FY Actuals2019Q1P01YTD
FY Actuals20192020052020FY Actuals2019Q1P02YTD
FY Actuals20192020052020FY Actuals2019Q1P03YTD
FY Actuals20192020052020FY Actuals2019Q2P04YTD
FY Actuals20192020052020FY Actuals2019Q2P05YTD
FY Actuals20192020052020FY Actuals2019Q2P06YTD
FY Actuals20192020052020FY Actuals2019Q3P07YTD
FY Actuals20192020052020FY Actuals2019Q3P08YTD
FY Actuals20192020052020FY Actuals2019Q3P09YTD
FY Actuals20192020052020FY Actuals2019Q4P10YTD
FY Actuals20192020052020FY Actuals2019Q4P11YTD
FY Actuals20192020052020FY Actuals2019Q4P12YTD
FY Actuals20192020052020FY Actuals2019Q4P13YTD
FY Actuals20192020062020FY Actuals2019Q1P01YTD
FY Actuals20192020062020FY Actuals2019Q1P02YTD
FY Actuals20192020062020FY Actuals2019Q1P03YTD
FY Actuals20192020062020FY Actuals2019Q2P04YTD
FY Actuals20192020062020FY Actuals2019Q2P05YTD
FY Actuals20192020062020FY Actuals2019Q2P06YTD
FY Actuals20192020062020FY Actuals2019Q3P07YTD
FY Actuals20192020062020FY Actuals2019Q3P08YTD
FY Actuals20192020062020FY Actuals2019Q3P09YTD
FY Actuals20192020062020FY Actuals2019Q4P10YTD
FY Actuals20192020062020FY Actuals2019Q4P11YTD
FY Actuals20192020062020FY Actuals2019Q4P12YTD
FY Actuals20192020062020FY Actuals2019Q4P13YTD

TIA

 

Regards

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @singh_gagan03 ,

 

If you want to create the Time indicator column, we can use the following steps to meet your requirement.

 

1. Create a Period number column.

 

Period number = CONVERT(RIGHT('Table'[Period],LEN('Table'[Period])-1),INTEGER)

 

P1.jpg

 

2. Then we can create a Time indicator column.

 

Time Indicator Column = 
SWITCH(
    TRUE(),
    'Table'[CC Year]=2020 && 'Table'[Period number]>=1&&'Table'[Period number]<=5,"YTD",
    'Table'[CC Year]=2020 && 'Table'[Period number]>5&&'Table'[Period number]<=13 ,"YTG",
    'Table'[CC Year]=2019,"YTG")

 

P2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared/

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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
v-zhenbw-msft
Community Support
Community Support

Hi @singh_gagan03 ,

 

How about the result after you follow the suggestions mentioned in my original post?

Could you please provide more details or expected result about it If it doesn't meet your requirement?

If you've fixed the issue on your own please kindly share your solution.

 

Best regards,

 

Community Support Team _ zhenbw

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

v-zhenbw-msft
Community Support
Community Support

Hi @singh_gagan03 ,

 

If you want to create the Time indicator column, we can use the following steps to meet your requirement.

 

1. Create a Period number column.

 

Period number = CONVERT(RIGHT('Table'[Period],LEN('Table'[Period])-1),INTEGER)

 

P1.jpg

 

2. Then we can create a Time indicator column.

 

Time Indicator Column = 
SWITCH(
    TRUE(),
    'Table'[CC Year]=2020 && 'Table'[Period number]>=1&&'Table'[Period number]<=5,"YTD",
    'Table'[CC Year]=2020 && 'Table'[Period number]>5&&'Table'[Period number]<=13 ,"YTG",
    'Table'[CC Year]=2019,"YTG")

 

P2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared/

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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