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
TCop93
Frequent Visitor

Year and Quarter as a date for time intelligence purpose

Hi,

I'm a PowerBI beginner and trying to put up a market share analysis for the place I work at but I encounter several issues on the way. I searched this forum to find the solution but I couldn't find any match! 

 

What's the issue?

TCop93_0-1623685631093.png

I'm trying to convert this column into 'Date' column to easily calculate QoQ, YoY and 4Qo4Q, both, for the company and market share via time intelligence. However, Power Query does not read this date type and I've got only year and a quarter as the date indicator. Any idea how to do it? It seems easy but after hours on figuring it out, I fail miserably. 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@TCop93 

you can create a column to transfer quarter to date

date = 
VAR q=right('Table (2)'[quarter],2)
return SWITCH(TRUE(),q="Q1",date(left('Table (2)'[quarter],4),1,1),q="Q2",date(left('Table (2)'[quarter],4),4,1),q="Q3",date(left('Table (2)'[quarter],4),7,1),date(left('Table (2)'[quarter],4),10,1))

1.PNG

what's more, if you want to use time intelligence, you need to use calendar function to create a calendar table.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
TCop93
Frequent Visitor

Hi @ryan_mayu ,

Thanks for your prompt answer and a solution to my query! I've tried it as:

 
Date = VAR q=RIGHT('IDC1'[Quarter],2) return SWITCH(TRUE();q="Q1";date(left('IDC1'[Quarter],4),1,1);q="Q2";date(left('IDC1'[Quarter],4),4,1);q="Q3";date(left('IDC1'[Quarter],4),7,1);q="Q4"date(left('IDC1'[Quarter],4),10,1))
 
I think Q4 indicator is missing so I've added it, and for some reason my 'IDC1[Quarter]' doesn't highligh as a right destination 😕 Could you have a look?
TCop93_0-1623694705486.png

 


 


 

 

@TCop93 

Are you creating a measure? pls try to create a column.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@TCop93 

If you only have 4 Q, then you don't need to set up the Q4 indicator. The rest value except Q1,Q2,Q3, all will be considered as Q4.

I didn't see your quarter column. pls try to change the quarter to the real name of your quarter column.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu 

 

My bad, I didn't create a new column... It works now, THANK YOU!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@TCop93 

you can create a column to transfer quarter to date

date = 
VAR q=right('Table (2)'[quarter],2)
return SWITCH(TRUE(),q="Q1",date(left('Table (2)'[quarter],4),1,1),q="Q2",date(left('Table (2)'[quarter],4),4,1),q="Q3",date(left('Table (2)'[quarter],4),7,1),date(left('Table (2)'[quarter],4),10,1))

1.PNG

what's more, if you want to use time intelligence, you need to use calendar function to create a calendar table.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.