Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
garythomannCoGC
Impactful Individual
Impactful Individual

power bi deskstop - debug calculated column result different in daxstudio

Have a calculated column that needed debugging to get the correct result.  Found the issue using daxstudio.  

But using the same code in power bi desktop still returns the incorrect result.  

Sounds like I have not transposed exactly OR there may be a difference in how daxstudio vs pbi works.

 

Calculated column from pbi desktop

garythomannCoGC_0-1716784608618.png

Calculated column in daxstudio with my debug wrapper code bits

garythomannCoGC_1-1716784684386.png

Table visual results

garythomannCoGC_2-1716785297992.png

Note  Org Plan Objective Weighting Rollup  should be all 2.00 for the three common rows.

To me both code chunks are the same.  The bug being needing ROUND() function wrapper to round up the result to the next integer  ie from 1.66 to 2.00

 

Stack Overflow link for bonus kudos 

https://stackoverflow.com/questions/78537250/power-bi-deskstop-debug-calculated-column-result-differ...

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @garythomannCoGC ,

 

there are two main differences when you try to debug the DAX code of calculated column using DAX Studio.

 

The most obvious difference is that using the DAX query pane in DAX Studio returns a table because of the required keyword EVALUATE whereas you are creating a scalar value when you are creating a CALCULATED COLUMN.

 

The 2nd difference when creating a calculated column is that you are starting from ROW CONTEXT.

 

For this reason it's necessary to use this pattern when you want to use DAX Studio:

EVALUATE
ADDCOLUMNS(
SUMMARUIZE(
<name of the table where you want to create the CALCULATED COLUMN>
, "name of the calculated column"
, <your DAX code>
)
)

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
garythomannCoGC
Impactful Individual
Impactful Individual

power bi deskstop - calculated column result different in daxstudio 

I still do not understand why pbi desktop table visual not giving the same result as per daxstudio.

The above is a replicable test.

garythomannCoGC
Impactful Individual
Impactful Individual

Thanks @TomMartens showing the interim calculations highlights what you said.  Will change my debug wrapper and continue.

garythomannCoGC_0-1716789337998.png

 

TomMartens
Super User
Super User

Hey @garythomannCoGC ,

 

there are two main differences when you try to debug the DAX code of calculated column using DAX Studio.

 

The most obvious difference is that using the DAX query pane in DAX Studio returns a table because of the required keyword EVALUATE whereas you are creating a scalar value when you are creating a CALCULATED COLUMN.

 

The 2nd difference when creating a calculated column is that you are starting from ROW CONTEXT.

 

For this reason it's necessary to use this pattern when you want to use DAX Studio:

EVALUATE
ADDCOLUMNS(
SUMMARUIZE(
<name of the table where you want to create the CALCULATED COLUMN>
, "name of the calculated column"
, <your DAX code>
)
)

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.