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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

extract month and year from each date (text format) using measure (data access denied)

hi everybody,

 

we had to extract month and year from each date (text format) in a table, using measure only.

We cannot access to data section to transform or add new column, the we need to add a measure to retrieve month and year from a text date.

 

So given the following table:

date_text

-------------

13/12/2020

21/12/2020

08/01/2021

17/01/2021

25/01/2021

12/02/2021

 

we need to obtain the following row using measure:

date_extraction_measure

-------------

12/2020

01/2021

02/2021

 

Thanks for your time,

SL

8 REPLIES 8
amitchandak
Super User
Super User

@Anonymous ,

Try a new column

right([date_text],7)

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
Anonymous
Not applicable

Hi, thanks for your answer. I cannot access to data section., then I cannot add columns. We can only add a measure.

Thanks

@Anonymous , you can get like

 

maxx(Table, right([date_text],7))

 

not sure how you want to use it

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
Anonymous
Not applicable

Nope! 
I need an output like this

date_extraction_measure

-------------

12/2020

01/2021

02/2021

 

with the previous formula I obtain only the max value

Hi @Anonymous ,

 

Create a measure as below:

Measure = RIGHT(MAX('Table'[Date]),7)

And you will see:

v-kelly-msft_0-1614850823762.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

Anonymous
Not applicable

Hi @v-kelly-msft ,

 

ok, but if you remove the column "Date" then only max date remains. 
I need a workaround to obtain a new column with a measure because I haven't access to data and data model.

thanks for your time,

SL

Hi @Anonymous ,

 

Measure has a context definition,without primary key,measure will be returned as a aggregated value,I dont know your actual environment,if you want it to be an actual column,you need to ask the data owner to create a calculated column or grant you the access for the data,otherwise it is impossible to simply get a column by measure without other columns for definition.

 

Best Regards,
Kelly

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

Anonymous
Not applicable

@amitchandak 

I think that a workaround is to scroll each row and for each row extract the month.

Is there possible to do it?

 

thanks again,

SL

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.