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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
hpatel24779
Helper I
Helper I

group dates to show anything prior to a date as one bar and the rest monthly

Hi All,

 

I have done this previously but seemed to have forgotten how i did it. i know you have to group dates but not exactly sure how.

 

I have a dataset with date ranging from 01/04/2020 to present. I want to create a visual where i can see one bar for anything prior to 01/04/2024 shown as 'Pre-April 24' and the rest shown monthly.

 

How can i achieve this? Below example of what i want to show. Please can you be kind enough by giving more detailed steps to solve my problem

 

hpatel24779_0-1733829310511.png

kind regards

 

Hetal

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @hpatel24779 
You can add column to the date table for grouping with the dax = 

date group = if ([Date]<= date(2024,04,01) ,"pre april 2024", 'Calendar'[Year-Month])
Ritaf1983_0-1733829894033.png

+
Add sort column :

date group sort = if ([Date]<= date(2024,04,01) ,0, 'Calendar'[Year-Month Code])
Sort the first column by the second :
Ritaf1983_1-1733830027567.png

from here create a graph

Ritaf1983_2-1733830153299.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
hpatel24779
Helper I
Helper I

thank you @Ritaf1983 this is exactly what i needed. also thanks for sharing pbix

Happy to help😍

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

Hi @hpatel24779 
You can add column to the date table for grouping with the dax = 

date group = if ([Date]<= date(2024,04,01) ,"pre april 2024", 'Calendar'[Year-Month])
Ritaf1983_0-1733829894033.png

+
Add sort column :

date group sort = if ([Date]<= date(2024,04,01) ,0, 'Calendar'[Year-Month Code])
Sort the first column by the second :
Ritaf1983_1-1733830027567.png

from here create a graph

Ritaf1983_2-1733830153299.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.