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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors