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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
fz1
Frequent Visitor

What-if Analysis with date fields

fz1_0-1714490248814.png

Hello, I have a dataset resembling the above format (~50k rows). I have the data loaded into a PowerBI dashboard with a bunch of different visuals. I am trying to build a calculator if possible to do what-if analysis, where the user will input a desired "Need to Receive By" date for a particular "Material", and a visual (for instance, a Card or Table) will spit out the "Purchase Order date" based on the average actual Lead Time for that material. For instance, if Material D needs to be ordered for a new car with a Need to Receive By date of 12/31/2024 (=user input), based on the average lead time for Material D of 5 months, the Purchase Order date (=output) should say 7/31/2024.

Is this functionality possible within PowerBI with parameters, etc.? Open to different solutions.

Thank you.

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @fz1 ,

Please try below steps:

1. Create a date table and create a slicer with date field

 

2. Calculate Average Lead Time

Average Lead Time = AVERAGE('YourTable'[LeadTimeColumn])

Replace 'YourTable' and 'LeadTimeColumn' with the actual names from your dataset.

 

3. Create a Measure for "Purchase Order Date"

Purchase Order Date =
DATEADD(
SELECTEDVALUE('YourParameter'[DateValue]),
-1 * [Average Lead Time],
MONTH
)

This formula assumes the lead time is in months. Adjust accordingly if your lead time is in a different unit.

 

4. Visualize the "Purchase Order Date": Finally, use a Card or Table visual to display the "Purchase Order Date" measure. As the user adjusts the "Need to Receive By" date parameter, the visual will update to show the calculated "Purchase Order date".

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-binbinyu-msft
Community Support
Community Support

Hi @fz1 ,

Please try below steps:

1. Create a date table and create a slicer with date field

 

2. Calculate Average Lead Time

Average Lead Time = AVERAGE('YourTable'[LeadTimeColumn])

Replace 'YourTable' and 'LeadTimeColumn' with the actual names from your dataset.

 

3. Create a Measure for "Purchase Order Date"

Purchase Order Date =
DATEADD(
SELECTEDVALUE('YourParameter'[DateValue]),
-1 * [Average Lead Time],
MONTH
)

This formula assumes the lead time is in months. Adjust accordingly if your lead time is in a different unit.

 

4. Visualize the "Purchase Order Date": Finally, use a Card or Table visual to display the "Purchase Order Date" measure. As the user adjusts the "Need to Receive By" date parameter, the visual will update to show the calculated "Purchase Order date".

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.