Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I've reviews a couple of the posts on here that show how to calculate a value between two dates but its they are not quite what I am looking for.
I have a dates tables that represents fiscal calendar weeks; it has a start and end date specified.
I would like an additonal "Total Amount" column on this table that is a sum of the Amount field from another table between those dates.
DatesTable
StartDate | EndDate | TotalAmount |
1 May | 7 May | 150 |
8 May | 14 May | 75 |
AmountsTable
Date | Amount |
2 May | 50 |
7 May | 100 |
8 May | 25 |
10 May | 25 |
13 May | 25 |
I've tried
TotalAmount = Calculate(SUM(AmountsTable[Amount]), FILTER(AmountsTable,AmountsTable[Date] <=
but then it won't let me add the Start or End date as a filter from the DatesTable.
I am sure this is something super easy but any help greatly appreciated.
t
Solved! Go to Solution.
if you are adding it as a calculated column, it should allow you to add Start and End dates,
In case of MEASURE you can wrap them inside selectedvalue function
As a MEASURE
Total Amount = CALCULATE ( SUM ( AmountsTable[Amount] ), FILTER ( AmountsTable, AmountsTable[Date] <= SELECTEDVALUE ( DatesTable[EndDate] ) && AmountsTable[Date] >= SELECTEDVALUE ( DatesTable[StartDate] ) ) )
TotalAmount = CALCULATE ( SUM ( AmountsTable[Amount] ), FILTER ( AmountsTable, AmountsTable[Date] <= DatesTable[EndDate] && AmountsTable[Date] >= DatesTable[StartDate] ) )
if you are adding it as a calculated column, it should allow you to add Start and End dates,
In case of MEASURE you can wrap them inside selectedvalue function
As a MEASURE
Total Amount = CALCULATE ( SUM ( AmountsTable[Amount] ), FILTER ( AmountsTable, AmountsTable[Date] <= SELECTEDVALUE ( DatesTable[EndDate] ) && AmountsTable[Date] >= SELECTEDVALUE ( DatesTable[StartDate] ) ) )
User | Count |
---|---|
80 | |
74 | |
62 | |
61 | |
46 |
User | Count |
---|---|
108 | |
97 | |
88 | |
81 | |
61 |