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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
nic2023
Frequent Visitor

Power Query Date Column: to display month based on an existing column

We are currently in month of August, I have a raw data with a column contains Dates ranged from later June to all possible July dates, the majority of the dates are July.  

The desired outcome is to add a column to show all entries (can be June or July) with a standardzied "Jul-23" as the majority dates within tha report, i.e. those entries dated with June also flagged as "Jul-23"

Is there any formula related to show MMM-YY from averged date or majority date point of view?

Thanks in advance. 

nic2023_0-1693196142241.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nic2023 ,

 

Raw data:

vstephenmsft_2-1693376782336.png

 

Final result:

vstephenmsft_0-1693376727060.png

 

Steps of the soltuion:

1.Add a custom column to return MonthYear based on the date column.

vstephenmsft_1-1693376756849.png

 

2.Group by the date column.

vstephenmsft_3-1693376821178.png

 

3.Add a custom to return the majority of the month year.

vstephenmsft_4-1693376855215.png

 

4.Fill down/up the monthyear.

vstephenmsft_6-1693376999412.png

vstephenmsft_7-1693380239812.png

 

5.Remove unneeded columns and expand the all rows, you will get the result.

vstephenmsft_8-1693380444826.png

 

You can also download my attachment for more details.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @nic2023 ,

 

Raw data:

vstephenmsft_2-1693376782336.png

 

Final result:

vstephenmsft_0-1693376727060.png

 

Steps of the soltuion:

1.Add a custom column to return MonthYear based on the date column.

vstephenmsft_1-1693376756849.png

 

2.Group by the date column.

vstephenmsft_3-1693376821178.png

 

3.Add a custom to return the majority of the month year.

vstephenmsft_4-1693376855215.png

 

4.Fill down/up the monthyear.

vstephenmsft_6-1693376999412.png

vstephenmsft_7-1693380239812.png

 

5.Remove unneeded columns and expand the all rows, you will get the result.

vstephenmsft_8-1693380444826.png

 

You can also download my attachment for more details.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

 

Hi Stephen, Would you be able to elaborate more on the above step 5? How to 'expand all rows"? 

5.Remove unneeded columns and expand the all rows

 

Thank you so much!

Mahesh0016
Super User
Super User

@nic2023  I hope this helps you. Thank You.

Mahesh0016_1-1693204632965.png

 

 


Create Custom Column
MMM YY =
Date.ToText(#date(Date.Year([DATETIME]), Date.Month([DATETIME]), Date.Day([DATETIME])), [Format="MMM-yy", Culture="de-DE"])

 

Note :
 change Culture="de-DE" based on your Region and location.

Thanks @Mahesh0016 

Yes, the Jul-23 can be populated as advised.

However the June dated entries are also show their real month as Jun-23 

The desired outcome is to show all entries with Jul-23 as the majority dates within tha report. 

Is there any formula related to show MMM-YY from averged date or majority date? 

Helpful resources

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

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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