Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello!
I have been working in Power bi for 2 moths, and I have an issue.
I have to show the everyday dislocation of tractors using 1C program (we use it in Ukraine).
Output data:
Date of moving | Tractors | Warehouse location |
01.01.2019 | Tractor - 1 | Warehouse A |
05.01.2019 | Tractor - 1 | Warehouse B |
08.01.2019 | Tractor - 1 | Warehouse C |
Date of moving is a date when tractor arrived at a warehouse
Also there is each directory for tractors and warehouses.
As you can see in tab 1 there are no all dates for every day and I need to do something like I showed in tab 2.
Tab 2
Date of moving | Tractors | Warehouse location |
01.01.2019 | Tractor - 1 | Warehouse A |
02.01.2019 | Tractor - 1 | Warehouse A |
03.01.2019 | Tractor - 1 | Warehouse A |
04.01.2019 | Tractor - 1 | Warehouse A |
05.01.2019 | Tractor - 1 | Warehouse B |
06.01.2019 | Tractor - 1 | Warehouse B |
07.01.2019 | Tractor - 1 | Warehouse B |
08.01.2019 | Tractor - 1 | Warehouse C |
I would be very grateful for your help with DAX or M in finding solution.
Solved! Go to Solution.
Please see the attached file with the improved code that is grouping Tractors First and then finds next date
hope this will solve your problem.
Please see the attached file with a solution.
Thank you, Mariusz! You did great job! However, let me ask you one more question. The file I have got from you works good, I copied code to my data and I got another issue.
Lets take a look at tractor 2. From 11.05.2016 it is at warehouse A .
And from 05.06.2016 it moves to warehouse B, but calculated dates work good till 27.05.2016 and then start from 05.06.2016.
In attached file I left this filter.
I would appreciate if you clarify why this code works for you and why not in my file.
link to the file https://1drv.ms/u/s!AkBOZZMFKBa1k29bSDO7hkS8HcN9?e=XFn6Lu
Please see the attached file with the improved code that is grouping Tractors First and then finds next date
hope this will solve your problem.
Everything works very well. Thanks for help!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 119 | |
| 100 | |
| 72 | |
| 69 | |
| 65 |