The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi have this formula in Dax , where I want to get just all the rows of data that has 7 or more days between each delivery
Hi @Pandadev
Add a Custom Column in Power Query which is the result of one delivery date minus the other. Then filter out the rows you don't need.
If you give us some idea of what the data looks like (column structure) I can write the code.
Thanks
Phil
Proud to be a Super User!
del_date_utc , del_date_time , del_id , date diff prev date
31/12/2019 31/12/2019 02:30:00 -19675 0
31/12/2019 31/12/2019 04:30:00 -19675 0
31/12/2019 31/12/2019 06:30:00 -19675 0
30/12/2019 30/12/2019 02:30:00 -19675 2
30/12/2019 30/12/2019 04:30:00 -19675 2
30/12/2019 30/12/2019 06:30:00 -19675 2
28/12/2019 28/12/2019 02:30:00 -19675 10
28/12/2019 28/12/2019 04:30:00 -19675 10
28/12/2019 28/12/2019 06:30:00 -19675 10
18/12/2019 18/12/2019 02:30:00 -19675 1
18/12/2019 18/12/2019 04:30:00 -19675 1
18/12/2019 18/12/2019 06:30:00 -19675 1
17/12/2019 17/12/2019 02:30:00 -19675 1
17/12/2019 17/12/2019 04:30:00 -19675 1
17/12/2019 17/12/2019 06:30:00 -19675 1
31/12/2019 31/12/2019 02:30:00 -10001 0
31/12/2019 31/12/2019 04:30:00 -10001 0
31/12/2019 31/12/2019 06:30:00 --10001 0
30/12/2019 30/12/2019 02:30:00 -10001 8
30/12/2019 30/12/2019 04:30:00 -10001 8
30/12/2019 30/12/2019 06:30:00 -10001 8
22/12/2019 22/12/2019 02:30:00 -10001 14
22/12/2019 22/12/2019 04:30:00 -10001 14
22/12/2019 22/12/2019 06:30:00 -10001 14
08/12/2019 08/12/2019 02:30:00 -19675 1
08/12/2019 08/12/2019 04:30:00 -10001 1
08/12/2019 08/12/2019 06:30:00 -10001 1
07/12/2019 07/12/2019 02:30:00 -10001 1
07/12/2019 07/12/2019 04:30:00 -10001 1
07/12/2019 07/12/2019 06:30:00 -10001 1
I would like to keep the earliest date time with a date diff of 7 or more , so from the above , i would like to keep the following rows
28/12/2019 28/12/2019 02:30:00 -19675 10
30/12/2019 30/12/2019 02:30:00 -10001 8
22/12/2019 22/12/2019 02:30:00 -10001 14
@Pandadev
Can you try this measure?
7 Plus Days =
CALCULATE(
max('del_Feed'[del_date_utc]),
FILTER(
SUMMARIZE('del_Feed','del_Feed'[del_id],'del_Feed'[del_date_utc])
'del_Feed'[del_id] = EARLIER('del_Feed'[del_id]) &&
'del_Feed'[del_date_utc] < EARLIER('del_Feed'[del_date_utc])
)
)
Check your data model for potential performance improvements.
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks I tried adding the measure , but get parameter not correct type
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
264 | |
120 | |
115 | |
83 | |
70 |