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
kavya
Frequent Visitor

Dynamic grouping in Power BI

Hi All,

 

Can any one suggest me on the dynamic grouping in power bi. My requirement is I have to do grouping for the dates based on the report run month. Ex: If the report is running on 01/06/2018 then current month to next 4 months is grouping, If report is running 01/07/2018 then 01/07/2018 to next 4 months is the grouping & From 2019 onwards the months to be displyed with out bucketing.

 

All the dates to be sorted based on calender.

 

Thanks

Kavya

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @kavya,

 

I'd like to suggest you use today function to get current date, then combo with if statement to check grouping range.

Sample column formula:

Grouping =
IF (
    [Date]
        IN CALENDAR (
            TODAY (),
            DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 4, DAY ( TODAY () ) )
        ),
    'groupping formula',
    BLANK ()
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin Sheng,

 

I had tried to apply the formula you had given, getting error like too few arguments were passed to the if condition, The minumum order count for the function is 2.

 

Thanks

Kavya 

Try to use function Now() to get current date and add 4 months in that.

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.