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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
Please help me to solve below logic.
if date1(Month) column greater than Date2(month) column and having month difference as 2 month then return "2 month difference"
if date1(Month) column greater than Date2(month) column and having month difference as 3 month then return "3 month difference"
Date1 Date2 Expected Calculated column
12/30/2019 10/25/2019 2 month difference
12/30/2019 11/25/2019 1 month difference
12/30/2019 9/25/2019 3 month differnce
Regards
Privya
Solved! Go to Solution.
datediff(date1,date2, MONTH)
refer https://docs.microsoft.com/en-us/dax/datediff-function-dax
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
@Anonymous
I would suggest you to read the documentation on Datediff.
https://docs.microsoft.com/en-us/dax/datediff-function-dax
If you need to show only positive numbers, use them in IF statement.
datediff(date1,date2, MONTH)
refer https://docs.microsoft.com/en-us/dax/datediff-function-dax
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 41 | |
| 29 | |
| 22 |
| User | Count |
|---|---|
| 135 | |
| 123 | |
| 56 | |
| 37 | |
| 32 |