cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


Anonymous
Not applicable

This works perfect. Thank you for the help JiHwan!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors