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.
Hi All,
I have a table structure which is:
And I want to convert it into the below sample shown:
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.
CC | CC Year | LC | LC Year | Last Year Cycle | Last Year | Quarter | Period | Time Indicator |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P01 | YTD |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P02 | YTD |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P03 | YTD |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P04 | YTD |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P05 | YTD |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P06 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P07 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P08 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P09 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P10 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P11 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P12 | YTG |
202005 | 2020 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P13 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P01 | YTD |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P02 | YTD |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P03 | YTD |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P04 | YTD |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P05 | YTD |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P06 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P07 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P08 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P09 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P10 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P11 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P12 | YTG |
202005 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P13 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P01 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P02 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P03 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P04 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P05 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P06 | YTD |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P07 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P08 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P09 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P10 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P11 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P12 | YTG |
202006 | 2020 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P13 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P01 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P02 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q1 | P03 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P04 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P05 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q2 | P06 | YTD |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P07 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P08 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q3 | P09 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P10 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P11 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P12 | YTG |
202006 | 2020 | FY Actuals | 2019 | FY Actuals | 2019 | Q4 | P13 | YTG |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P01 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P02 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q1 | P03 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P04 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P05 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q2 | P06 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P07 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P08 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q3 | P09 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P10 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P11 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P12 | YTD |
FY Actuals | 2019 | 202005 | 2020 | FY Actuals | 2019 | Q4 | P13 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P01 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P02 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q1 | P03 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P04 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P05 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q2 | P06 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P07 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P08 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q3 | P09 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P10 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P11 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P12 | YTD |
FY Actuals | 2019 | 202006 | 2020 | FY Actuals | 2019 | Q4 | P13 | YTD |
TIA
Regards
Solved! Go to Solution.
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)
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")
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.
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.
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)
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")
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.
@singh_gagan03 , what is the reason for doing this. Are you looking for time intelligence?
If they are stand period refer : https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-1-Time-Intell...
If they are non-standard: https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
Creation of calendar :
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |