Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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!!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 35 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |