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
What's the difference between two dax calculations for Date Difference?
Solved! Go to Solution.
Hi @sonisick - this is make sense because FIRSTDATE - DAX Guide and LASTDATE - DAX Guide are table functions. This means the function produce results in a Table. So you are effectively asking for Table A - Table B. I guess the FORMAT allows the results to be converted to Text String that looks like a number. When using the DATEDIFF - DAX Guide function instead of minus, the result is a Scalar value. This mean the function produces a single integer value.
Try the following instead as MAX and MIN are scalar functions.
Duration Max/Min = MAX(FactInternetSales[DueDate])- MIN(FactInternetSales[DueDate]) + 1
Hi @sonisick - this is make sense because FIRSTDATE - DAX Guide and LASTDATE - DAX Guide are table functions. This means the function produce results in a Table. So you are effectively asking for Table A - Table B. I guess the FORMAT allows the results to be converted to Text String that looks like a number. When using the DATEDIFF - DAX Guide function instead of minus, the result is a Scalar value. This mean the function produces a single integer value.
Try the following instead as MAX and MIN are scalar functions.
Duration Max/Min = MAX(FactInternetSales[DueDate])- MIN(FactInternetSales[DueDate]) + 1
Hi @sonisick
At first glance it is because in your first expression you have 0 wrapped in quotations. By doing this Power BI will then format the expression as text. Could you try removing the quotations to see if this changes anything.
Thanks for your answer, but unquoting doesn't help the problem.
Hi @sonisick - The FORMAT – DAX Guide function will convert the Number result to Text string. The ABS value will retain the number value. This is why the visual is becoming confused when you try sorting the heirarchy.
This is the expression the instructor started from
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 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |