Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to create a calendar that shows only Sunday (one day out of a week).
This is code that I used to create a Calendar table.
Expected output is showing only rows that have
7/4/21
7/11/21
7/18/21
...
How do I modify on this DAX?
Thanks.
Solved! Go to Solution.
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.
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.
Hi @JustinDoh1
Try this code to create your table:
Simple Date =
VAR DateStart =
DATE ( 2021, 7, 1 )
VAR DateEnd =
DATE ( 2021, 12, 31 )
VAR DateTable =
ADDCOLUMNS (
CALENDAR ( DateStart, DateEnd ),
"weeknum", WEEKNUM ( ''[Date], 1 ),
"Day Name", FORMAT ( [Date], "dddd" )
)
RETURN
FILTER ( DateTable, [Day Name] = "Sunday" )
Output:
You can cretae your Calendar table in Power Query as well, see this link:
https://www.vahiddm.com/post/creating-calendar-table-with-3-steps
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
User | Count |
---|---|
42 | |
28 | |
23 | |
18 | |
15 |
User | Count |
---|---|
54 | |
35 | |
18 | |
17 | |
15 |