Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Starting Position:
Goal:
Approach:
Problem:
NB: I already tried DATESBETWEEN but failed to keep the start date dynamic
I have already checked out these threads, but the issue I'm faced with is a bit different:
Based on an overview of the current balances (with specific date X) I need to reconstruct the past balances (daily) by creating a measure that's subtracting the sum of purchases and adding the sum of sales that happened between each day and the date X
If date if fixed by a slicer then
Inventory till date = Var _min_date_for_inventory = CALCULATE(maxx(all('Date'[Date Filer]),'Date'[Date Filer])) Var _Todays_date=CALCULATE(maxx(ALLSELECTED('Date'[Date Filer]),'Date'[Date Filer])) Var _inventory= CALCULATE(sum(Sales[Sales Amount]),all(Sales[Sales Date].[Date]),Sales[Sales Date]<=_min_date_for_inventory) Var Sale_till_tody =CALCULATE(sum(Sales[Sales Amount]),filter(sales,Sales[Sales Date]<=maxx(Sales,Sales[Sales Date].[Date]))) Var purchase_till_tody =CALCULATE(sum(Sales[Sales Amount]),filter(sales,Sales[Sales Date]<=maxx(Sales,Sales[Sales Date].[Date]))) return _inventory -Sale_till_tody+purchase_till_tody
_inventory is optional , can be removed
will it work if the end date is fixed but the start date is variable?
Because the goal is to have a bar chart with the days on the x-axis which are the respective start dates.
For example:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |