Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to Calculate Based on Slicer Range Date and the Value Associated with The MIN Date

Hi Everyone!

 

I am newer to PowerBI and this forum. I am trying to put together something that seemed more simple than it is turning out to be, especially since I have little working knowledge of DAX. I am trying to duplicate the following from Excel into PowerBI.

 

West_0-1648845880370.png

The "Trucks Movement" column is taking the "Total Trucks" amount and finding the difference between the associated date of that row and row with the oldest available date in the table (in the above example every row is finding the difference between it and the row with the oldest date of 02/21/2022). This is the same for the open "Trucks Movement" column as well but it is taking from the "Open Trucks' column.

 

The largest issue I have with this is the need for it to adjust with a date slicer, so if someone were to move dates from (02/21/2022 through 03/11/2022) to (03/01/2022 through 03/11/2022) it would look like the following, since those number would adjust with the oldest date changing from 02/21/2022 to 03/01/2022.

 

West_1-1648846745996.png

 

I have been searching through the forum and trying my best to piece things together, but haven't been able to get to something that works. Below is a copy of the original data in a text format. Thank you for taking the time to read through this, I really appreciate any help!

 

DateTotal TrucksOpen TrucksOpen Truck %
2/21/20225036.0%
2/22/202249510.2%
2/24/20225024.0%
2/25/20225535.5%
2/28/20225335.7%
3/1/202250612.0%
3/2/202250816.0%
3/3/20225123.9%
3/4/202252611.5%
3/7/20225036.0%
3/8/20224936.1%
3/9/20224724.3%
3/10/20224936.1%
3/11/202250816.0%
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

Picture2.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

Picture2.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Anonymous
Not applicable

This works perfect. Thank you for the help JiHwan!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.