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

Compare same days of different months

Good morning people, everything fine?

So, I want to create a column that gives me the incidence of that day in the month, example:

that on the date of the first Monday of the month, the column brings me 1mon, on the first Tuesday of the month it brings me 1tue, and so on for all days and all incidences, such as third Mondays of the month and so on.

Can you help me please?

the table is in my mother language, but the format is Data as date, nome do mês as name of the month, nome do dia as name of the day (monday, tuesday, saturday and go on) and the last is semana do mês as week of the month.

zelira_0-1702039352387.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your calendar table looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

It is for creating a new column.

I hope the below can provide some ideas on how to create a solution for your semantic model.

 

Jihwan_Kim_0-1702186755788.png

 

RANK function (DAX) - DAX | Microsoft Learn

 

Expected result CC =
VAR _currentrowdaynamenumber = 'Calendar'[Day name number]
VAR _rankdayname =
    RANK (
        SKIP,
        SUMMARIZE (
            'Calendar',
            'Calendar'[Date],
            'Calendar'[Year],
            'Calendar'[Month name],
            'Calendar'[Month number],
            'Calendar'[Day name],
            'Calendar'[Day name number]
        ),
        ORDERBY ( 'Calendar'[Date], ASC ),
        DEFAULT,
        PARTITIONBY (
            'Calendar'[Day name number],
            'Calendar'[Month number],
            'Calendar'[Year]
        ),
        MATCHBY ( 'Calendar'[Date] )
    )
RETURN
    _rankdayname & " | " & 'Calendar'[Day name]

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your calendar table looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

It is for creating a new column.

I hope the below can provide some ideas on how to create a solution for your semantic model.

 

Jihwan_Kim_0-1702186755788.png

 

RANK function (DAX) - DAX | Microsoft Learn

 

Expected result CC =
VAR _currentrowdaynamenumber = 'Calendar'[Day name number]
VAR _rankdayname =
    RANK (
        SKIP,
        SUMMARIZE (
            'Calendar',
            'Calendar'[Date],
            'Calendar'[Year],
            'Calendar'[Month name],
            'Calendar'[Month number],
            'Calendar'[Day name],
            'Calendar'[Day name number]
        ),
        ORDERBY ( 'Calendar'[Date], ASC ),
        DEFAULT,
        PARTITIONBY (
            'Calendar'[Day name number],
            'Calendar'[Month number],
            'Calendar'[Year]
        ),
        MATCHBY ( 'Calendar'[Date] )
    )
RETURN
    _rankdayname & " | " & 'Calendar'[Day name]

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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