Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
87 | |
84 | |
68 | |
49 |
User | Count |
---|---|
131 | |
111 | |
96 | |
71 | |
67 |