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 have 2 date columns that need to be compared to each other to see which date is greater than the other. If date1 > date2 then 0. If date1 < date2 then 1. From there I need to calculate the average between those 0-1 values. When performing DAX
Solved! Go to Solution.
Hi, @Anonymous ;
You could create a measure as follow:
flag2 =
AVERAGEX(SUMMARIZE('Table',[Date1],[date2],
"1",IF(MAX('Table'[Date1])>MAX('Table'[date2]),0,1)),[1])
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous ;
You could create a measure as follow:
flag2 =
AVERAGEX(SUMMARIZE('Table',[Date1],[date2],
"1",IF(MAX('Table'[Date1])>MAX('Table'[date2]),0,1)),[1])
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
Hi,
Use SELECTEDVALUE function.
Thanks
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 192 | |
| 125 | |
| 99 | |
| 67 | |
| 48 |