Forum Discussion
Calculated Calendar Table and Relationships to Date Column?
I have 2 tables.
1. Calculated Date Calendar table
2. Table with Orders, Order Scheduled Date, and Order Closed Date.
I have a calculated date table that is Dynamic:
| Order | Scheduled Date | Closed Date |
| 123 | January 2020 | March 2020 |
Ideal State: Order Organized by Month
| Jan 2020 | Feb 2020 | Mar 2020 | |
| Orders Closed after Scheduled Date | 0 | 0 | 1 |
Current State: Order Organized
| Jan 2020 | Feb 2020 | Mar 2020 | |
| Orders Closed after Scheduled Date | 1 | 0 | 0 |
3 Replies
- amitchandak
Super User
PBIUWO , Open you have also joined your date table with close date and that is an inactive join. Activate that for this formula using userealtion.
Should correct that
- PBIUWO
Helper III
Thank you,
I have it gotten it to work. But now, whenever I try to filter anything that has Schedule Date > Closed Date. The numbers dissappear.
Do you know why?
Also, does this mean that I should always delete instead of inactivating the relationships?
- AnonymousNot applicable
Hi PBIUWO ,
You could following these steps:
1. Create a calendar table:
Calendar = VAR _max = IF ( MAX ( 'Order'[Scheduled Month/Year] ) > MAX ( 'Order'[Closed Month/Year] ), MAX ( 'Order'[Scheduled Month/Year] ), MAX ( 'Order'[Closed Month/Year] ) ) VAR _min = IF ( MIN ( 'Order'[Scheduled Month/Year] ) < MIN ( 'Order'[Closed Month/Year] ), MIN ( 'Order'[Scheduled Month/Year] ), MIN ( 'Order'[Closed Month/Year] ) ) RETURN ADDCOLUMNS ( CALENDAR ( _min, _max ), "Month Year", FORMAT ( [Date], "MMM YY" ) )2.Use SUMMARIZE() to "connect" calendar table and year-month column:
LIST = SUMMARIZE ( 'Calendar', 'Calendar'[Month Year] )3.Count Closed after Scheduled
Measure = SUMX ( FILTER ( 'Order', 'Order'[Month Year closed] = MAX ( 'LIST'[Month Year] ) ), 'Order'[Closed > Scheduled] ) + 0My visualization looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.Best Regards,
Eyelyn Qin