Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello everyone,
I need a PBI expert's help. Please refer to the table I've copied over. I need to generate a table of custom dates and information. Essentially using this table, I need DAX to generate a table/list of all Mondays [DDD] from the 1st week of the month [Month_Week_Num] for the given timeframe [Block Effective Start Date] - [Block Effective End Date] for each of the [Surgeons] which I've blinded.
I think it's a matter of using a combination of FILTER CROSSJOIN UNION, etc but I can't seem to get it to work.
For instance, just looking at Surgeon 1, the table should look like:
1/3 Mon Surgeon A
2/7 Mon Surgeon A
3/7 Mon Surgeon A
4/4 Mon Surgeon A
5/2 Mon Surgeon A
6/6 Mon Surgeon A
1/3 Mon Surgeon B
2/7 Mon Surgeon B
3/7 Mon Surgeon B
4/4 Mon Surgeon B
5/2 Mon Surgeon B
6/6 Mon Surgeon B
Any help would be appreciated.
Solved! Go to Solution.
@vapid128 I think you are getting closer!
The photo I attached is a better explanation of what I am looking for and I think you are on the right track of using GENERATE/GENERATESERIES. Example (referring to the photo)....The table on the left is the schedule table that is manually entered, the table on the right is what I would like to generate.
Example: Employee A, was scheduled to work on the Monday of the 1st week of every month between Start Date 1/1/2022 and end date 6/30/2022. Employee B was scheduled to work on every third Tuesday between his start date 5/1/2022 and 7/1/2022. Employee C was scheduled to work on every 2nd Thursday from 2/1/2022 to 5/30/2022.
This is awesome @vapid128 ! One question, how is [Values] generated? These are all new concepts to me so I'm interested in learning more! Thanks again! You've been extremely helpful!
It is a combo formule
GENERATE(Table,GENERATESERIES(start number from table, end number from table))
I create a index: year*12+month
If we use YYYYMM like 202201 to 202206, it will generate 202201/202202/202203/202204/202205/202206.
When your date is from 202112 to 202206 it will generate 202112/202113/202114/..../202206.
Therefore, we need rewirte this to year*12+month as a index.
And use
@vapid128 I have Start_Date starting from previous years. Any year < 2022 is giving block_day a blank. Suggestions?
If the blank is in block_day colnum,
that is because
return IF(_block_day>=[Start_date] && _block_day<=[End_date],_block_day,BLANK())
Thanks for replying! The table I attached will eventually have different variations of Weeks and Days, so for instance the table in the attachment will have the second Tuesday of the month, third Thursday of the month, etc... so how should build it?
updated solution
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
21 | |
20 | |
14 | |
13 |
User | Count |
---|---|
43 | |
37 | |
25 | |
24 | |
23 |