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
krrish116
Resolver II
Resolver II

Extract Months and Quarters from Year in format YYYY

Hi @amitchandak ,

I have two queries..

1.  Im using Direct Query and i have a table with column Year and i dont have months and Quarters for this Table.

   So, I want to extract Months and Columns from Year with format (YYYY).

   Year

   2017

   2018

   2019

  2020

 

2. And in one Graph im showing Years and Profits and i want to show only the data from 2019, 2020.

and if we have new data for 2021 then we have to show 2019,2020 ,2021 like that..

 

Please give me these two answers.

Thanks,

Krish.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@krrish116 , In the first question when do not have a month and have year only what you want to extract.

 

For the second one , see if you are able to add this column // direct query allows few type of columns

new flag = if([year]>=2019,1,0)

 

and take this at visual of page-level and filter

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@krrish116 , In the first question when do not have a month and have year only what you want to extract.

 

For the second one , see if you are able to add this column // direct query allows few type of columns

new flag = if([year]>=2019,1,0)

 

and take this at visual of page-level and filter

Hi @amitchandak ,

I have a date column in direct query and i want to extract date months quarters and years from that date, which is in format "mm/dd/yyyy".

Please let me know how it is possible in Direct Query.

Thanks,

Krish..

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.