Forum Discussion
How to compare data at 2 different dates
- Anonymous4 years ago
Hi Sylvain74 ,
I updated your sample pbix file(see attachment), please check whether it can get your expected result.
1. Update the formula of measure [Scenario - Delivered Quantity ] as below
Scenario - Delivered Quantity = VAR _selactdates = ALLSELECTED ( 'Scenario Actual Date'[VALUATION_DATE] ) VAR _selscedates = ALLSELECTED ( 'Scenario Dates'[VALUATION_DATE] ) RETURN CALCULATE ( SUM ( 'Contract Deliveries'[DeliveredQuantity] ), FILTER ( 'Contract Deliveries', 'Contract Deliveries'[ValuationDate] IN _selactdates || 'Contract Deliveries'[ValuationDate] IN _selscedates ) )2. Create a new measure as below to get the sum of contract quantity
Scenario - ContractQuantity = VAR _selactdates = ALLSELECTED ( 'Scenario Actual Date'[VALUATION_DATE] ) VAR _selscedates = ALLSELECTED ( 'Scenario Dates'[VALUATION_DATE] ) RETURN CALCULATE ( SUM ( 'Contract Deliveries'[ContractQuantity] ), FILTER ( 'Contract Deliveries', 'Contract Deliveries'[ValuationDate] IN _selactdates || 'Contract Deliveries'[ValuationDate] IN _selscedates ) )Best Regards
Sylvain74 based on what lbendlin suggests, I have a blog post of a similar use case, you can read it here Compare Budgeted Scenarios vs. Actuals | PeryTUS IT Solutions and use it in your solution.
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡