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
I am using Power Pivot in EXCEL not Power BI.
Trying to compare dates with an if statement from two columns and when the date matches I want to sum a 3rd columns.
Here is the DAX formula I have, which is not working. What do I need to change to be able to compare the dates and then sum up the values?
I also created date tables for the two date columns. Didn't work either.
MM CM:=IF(VALUE('Vendor Trend'[CAP Date Paid])=VALUE('Vendor Trend'[CAP Date Aff]), SUM([TOTAL MM]))
MM CM:=IF(VALUE('Calendar'[Date])=VALUE('Calendar_Dt Aff'[Date]), SUM([TOTAL MM]))
Hi @meierli
Thank you very much aduguid for your prompt reply.
Try this:
MM CM =
CALCULATE(
SUM('Vendor Trend'[TOTAL MM]),
FILTER(
'Vendor Trend',
'Vendor Trend'[CAP Date Paid] = 'Vendor Trend'[CAP Date Aff]
)
)
MM CM =
CALCULATE(
SUM('Vendor Trend'[TOTAL MM]),
FILTER(
'Calendar',
'Calendar'[Date] = 'Calendar_Dt Aff'[Date]
)
)
If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try this measure
MM CM :=
CALCULATE(
SUM('Vendor Trend'[TOTAL MM]),
'Vendor Trend'[CAP Date Paid] = 'Vendor Trend'[CAP Date Aff]
)
or this one if you're using a calendar table
MM CM :=
CALCULATE(
SUM('Vendor Trend'[TOTAL MM]),
'Calendar'[Date] = 'Calendar_Dt Aff'[Date]
)
Thank for your suggestion. But I got enclosed error. Any idea why?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 20 | |
| 13 | |
| 12 |