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
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
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.