Forum Discussion
Considering Specific Days Between Two Dates
- 4 years ago
Ryukatan10
Here is a sample file with the solution https://www.dropbox.com/t/08giOHP4Wl2Oy6Q7You need first to unpivote the weekday columns in the flights table:
Rename the "Value" column
Delete the "Attribute" column
Filter out Zero values
Create the relationship with the Date table (Make sure the Weekday numbering system is the same in both tables). In your real data the relationship will be Many to Many
Create the table visual (Flight > from Flights table and Date > from Date table)
Create the Filter measure that will filter only the existing Dates between "Begining" and "End"
Flight Dates = COUNTROWS ( FILTER ( 'Date', 'Date'[Date] >= MAX( Flights[Begin Operation] ) && 'Date'[Date] <= MAX ( Flights[End Operation] ) ) )Place the measure in the Filter Pane and select "Is not blank" then apply
Hi tamerj1 the second table is like this:
| Data | Dia da Semana |
| 01.jan.2022 | 2 |
| 02.jan.2022 | 3 |
| 03.jan.2022 | 4 |
| 04.jan.2022 | 5 |
| 05.jan.2022 | 6 |
| 06.jan.2022 | 7 |
| 07.jan.2022 | 1 |
| 08.jan.2022 | 2 |
| 09.jan.2022 | 3 |
| 10.jan.2022 | 4 |
| 11.jan.2022 | 5 |
| 12.jan.2022 | 6 |
| 13.jan.2022 | 7 |
| 14.jan.2022 | 1 |
| 15.jan.2022 | 2 |
| 16.jan.2022 | 3 |
| 17.jan.2022 | 4 |
| 18.jan.2022 | 5 |
I have the dates and a number that identifies the Weekday Name, 1 for Monday and 7 for Sunday