Forum Discussion
Select Latest ID From Slow Changing Dimension Table Based On Date Slicer
- 2 years ago
Hi all ,
Anonymous , thanks for your concern about this case, I have some additions for problem solving.
alee5210 , thank you for giving a specific description of the problem. Based on your imformation, I will give you the following steps to solve the problem.
1.The test table Data table, Date table, EffectiveDate.
2.The test model.
3.New Measure FILTER, and input:
FILTER = VAR _select = SELECTEDVALUE(EffectiveDate[Date]) VAR _End = CALCULATE( MAX('Data table'[Effective End Date]), ALLEXCEPT('Data table', 'Data table'[Test ID]), 'Data table'[Effective Start Date] <= _select ) RETURN IF( MAX('Data table'[Effective Start Date]) <= _select && MAX('Data table'[Effective End Date]) = _End, 1, 0 )4.Add Date to Field.
5.Add FILTER to Filters on this visual.
6.The outcome is in the following pictures.
If they select the user selects 2 Jan, 2024
If they select 16 Jan, 2024
If they select 31 Jan, 2024
All above contents can answer your original questions. For your latest questions, it probably due to the relationship you have between the Data table and the Date table. When the relationship looks like this picture, the same result will appear as you.
Best Regards,
Caroline Mei
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is a bit of a pain as I've also added some additional fields to my date table so it looks like the below.
| Date | Reporting Week | Data Period | ||
| 01/01/2024 | 01/01/2024 | |||
| 02/01/2024 | 01/01/2024 | |||
| 03/01/2024 | 01/01/2024 | |||
| 04/01/2024 | 01/01/2024 | |||
| 05/01/2024 | 01/01/2024 | |||
| 06/01/2024 | 01/01/2024 | |||
| 07/01/2024 | 01/01/2024 | |||
| 08/01/2024 | 08/01/2024 | |||
| 09/01/2024 | 08/01/2024 | |||
| 10/01/2024 | 08/01/2024 | |||
| 11/01/2024 | 08/01/2024 | |||
| 12/01/2024 | 08/01/2024 | |||
| 13/01/2024 | 08/01/2024 | |||
| 14/01/2024 | 08/01/2024 | |||
| 15/01/2024 | 15/01/2024 | |||
| 16/01/2024 | 15/01/2024 | |||
| 17/01/2024 | 15/01/2024 | |||
| 18/01/2024 | 15/01/2024 | Last 2 Weeks | ||
| 19/01/2024 | 15/01/2024 | Last 2 Weeks | ||
| 20/01/2024 | 15/01/2024 | Last 2 Weeks | ||
| 21/01/2024 | 15/01/2024 | Last 2 Weeks | ||
| 22/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 23/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 24/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 25/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 26/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 27/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 28/01/2024 | 22/01/2024 | Last 2 Weeks | ||
| 29/01/2024 | 29/01/2024 | Last 2 Weeks | ||
| 30/01/2024 | 29/01/2024 | Last 2 Weeks | ||
| 31/01/2024 | 29/01/2024 | Last 2 Weeks |
I use the reporting week and the data period field in my dashboard. I noticed that when I use the 2 tables together, the dashboard begins to function in an unusual way and does not give predictable reults.
If I try your method of the disconnected table it is working well.
But the moment I bring in the first connected table, things get a bit weird. I'm no longer getting the same results as I would have expected. Is there anyway that I can ammend this? This is driving me crazy!
Hi all ,
Anonymous , thanks for your concern about this case, I have some additions for problem solving.
alee5210 , thank you for giving a specific description of the problem. Based on your imformation, I will give you the following steps to solve the problem.
1.The test table Data table, Date table, EffectiveDate.
2.The test model.
3.New Measure FILTER, and input:
FILTER =
VAR _select = SELECTEDVALUE(EffectiveDate[Date])
VAR _End =
CALCULATE(
MAX('Data table'[Effective End Date]),
ALLEXCEPT('Data table', 'Data table'[Test ID]),
'Data table'[Effective Start Date] <= _select
)
RETURN
IF(
MAX('Data table'[Effective Start Date]) <= _select && MAX('Data table'[Effective End Date]) = _End,
1,
0
)
4.Add Date to Field.
5.Add FILTER to Filters on this visual.
6.The outcome is in the following pictures.
If they select the user selects 2 Jan, 2024
If they select 16 Jan, 2024
If they select 31 Jan, 2024
All above contents can answer your original questions. For your latest questions, it probably due to the relationship you have between the Data table and the Date table. When the relationship looks like this picture, the same result will appear as you.
Best Regards,
Caroline Mei
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.