Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
What I'm trying to do is SUM all the Inventory if the CategoryEnding Date is <= the Weekending Date.
TABLE1 is a simple calendar
TABLE2 is a table with Ending Date and Inventory
NO Relationships (because that ties the dates together)
= CALCULATE(SUM([Inventory]),[CategoryEnding]<='TABLE1'[Weekending])
This gives "expecting a true/false
How can I write this DAX measure please?
TABLE1 | TABLE2 | ||||||
Weekending | CategoryEnding | Inventory | |||||
10/14/2022 | 10/28/2022 | $1,000 | |||||
10/21/2022 | 11/11/2022 | $5,000 | |||||
10/28/2022 | 11/18/2022 | $500 | |||||
11/4/2022 | 12/2/2022 | $7,500 | |||||
11/11/2022 | |||||||
11/18/2022 | |||||||
11/25/2022 | |||||||
12/2/2022 | |||||||
PBI Table | |||||||
WeekEnding | Total to CategoryEnding | Notes | |||||
10/14/2022 | $14,000 | Since all Dates are > Weekending Date they SUM | |||||
10/21/2022 | $14,000 | ||||||
10/28/2022 | $14,000 | ||||||
11/4/2022 | $13,000 | lose the 10/28 Category Ending | |||||
11/11/2022 | $13,000 | ||||||
11/18/2022 | $8,000 | lose the 11/11 Category Ending | |||||
11/25/2022 | $7,500 | lose the 11/18 Category Ending | |||||
12/2/2022 | $7,500 | ||||||
12/9/2022 | $0 | lose the 12/2 Category Ending |
Solved! Go to Solution.
@nesselman , if they are not related you can work on selected value or min or max
example
CALCULATE(SUM(Table2[Inventory]),filter(Table2, table2[CategoryEnding]<=max('TABLE1'[Weekending]) ))
Measure= var A=CALCULATE(SUM([Inventory]),userelationship(CategoryEnding Date ,Weekending Date)
Var Result=calculate(A,Filter(Table,Table(MinCategoryEnding Date)<=max(table,Weekending Date)
return
result
@nesselman , if they are not related you can work on selected value or min or max
example
CALCULATE(SUM(Table2[Inventory]),filter(Table2, table2[CategoryEnding]<=max('TABLE1'[Weekending]) ))
Yes, that worked using "max". I needed it the other way so I used:
>=MAX
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
79 | |
53 | |
39 | |
39 |
User | Count |
---|---|
104 | |
85 | |
47 | |
44 | |
43 |