Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello,
I am trying to write a DAX formula which forces the Quantity data field to go to zero after the "Due Date" has been reached, only for "Deal Type" B2. This report uses both the "Order Date" and "Due Date" as x-axes for several visualizations, and the different dates have been giving me trouble in DAX.
*This is a sample data created off of my actual very large data set.
Thank you so much for your help!!
Solved! Go to Solution.
Hello @Anonymous
Give this a try. This measure assumes you don't already have another measure that just sums quantity.
Quantity Adjusted =
CALCULATE (
SUM ( Table1[Quantity] ),
KEEPFILTERS (
FILTER (
ALL ( Table1[Deal Type], Table1[Order Date], Table1[Due Date] ),
NOT ( Table1[Deal Type] = "B2"
&& Table1[Due Date] >= Table1[Order Date] )
)
)
)
Hello @Anonymous
Give this a try. This measure assumes you don't already have another measure that just sums quantity.
Quantity Adjusted =
CALCULATE (
SUM ( Table1[Quantity] ),
KEEPFILTERS (
FILTER (
ALL ( Table1[Deal Type], Table1[Order Date], Table1[Due Date] ),
NOT ( Table1[Deal Type] = "B2"
&& Table1[Due Date] >= Table1[Order Date] )
)
)
)
Yes, that worked!! Thank you!!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 18 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 51 | |
| 44 | |
| 43 | |
| 39 | |
| 32 |