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
tsak
New Member

Display months based on days

How can I display months based on the first Monday of each month??

For example August 21 should be from 02/08/2021 - 05/09/2021

I have calculated the iso week based on WEEKNUM([Date],21), so what I want basically is August 21 to include Iso week 31-35

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @tsak 

 

After my test, I create a calculated column to diaplay the monthnum you want.

Like this:

monthnum = 
MAXX (
    FILTER (
        'Table',
        [Date] <= EARLIER ( 'Table'[Date] )
            && IF ( WEEKDAY ( [Date], 2 ) = 1, ( MONTH ( [Date] ) ) )
                <> BLANK ()
    ),
    IF ( WEEKDAY ( [Date], 2 ) = 1, ( MONTH ( [Date] ) ) )
)

vjaneygmsft_0-1633075097957.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @tsak 

 

After my test, I create a calculated column to diaplay the monthnum you want.

Like this:

monthnum = 
MAXX (
    FILTER (
        'Table',
        [Date] <= EARLIER ( 'Table'[Date] )
            && IF ( WEEKDAY ( [Date], 2 ) = 1, ( MONTH ( [Date] ) ) )
                <> BLANK ()
    ),
    IF ( WEEKDAY ( [Date], 2 ) = 1, ( MONTH ( [Date] ) ) )
)

vjaneygmsft_0-1633075097957.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

Thank you very much @v-janeyg-msft 

Burningsuit
Resident Rockstar
Resident Rockstar

Hi @tsak 

You're going to need a DateTable in your data model. This is a table that has a sequential list of all dates found in your data and columns that define those dates. A simple DateTable for you could look like this..

 

DateMondayMonthMmno
30/08/2021  August8
31/08/2021  August8
01/09/2021  August8
02/09/2021  August8
03/09/2021  August8
04/09/2021  August8
05/09/2021  August8
06/09/2021  September9
07/09/2021  September9
08/09/2021  September9

 

This could be created in Excel, or more powerfully built in Dax or PowerQuery.

In the Datamodel relate the DateTable[Date] to the date column  in your data.

You can then use MondayMonth on charts and visuals to refer to dates that relate to it. 

In the DateTable sort MondayMonth by Mmno (Sort by Column in data view in Power BI Desktop) so that MondayMonth appears in the correct time order, not alphabetical order.

You can do a lot of things with a DateTable to analyse your data by time periods other than the standard.

Read more here Set and use date tables in Power BI Desktop - Power BI | Microsoft Docs

 

Hope this helps

 

Stuart

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.

Top Solution Authors
Top Kudoed Authors