The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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.
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]
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.
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]
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |