Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

power bi deskstop – calculated column result different in daxstudio

Carrying on from my previous question  here  
I still do not understand why pbi desktop table visual not giving the same result as per daxstudio.

Replicated test

--  parent - child rollup test
--  3 rows, 3 values, sumx
EVALUATE
--RollupTest = 
DATATABLE (
    "name", STRING,
    "child value", INTEGER,
    {
        { "test1", 1 },
        { "test2", 3 },
        { "test3", 1 } 
    }
)



EVALUATE
--rollup test =
VAR _rollup =
    SUMX (
        CALCULATETABLE (
            'RollupTest'
        ),
    'RollupTest'[child value]
    )
RETURN
    { _rollup }

Daxstudio

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Yep, we get 5  (1+3+1)  correct

PBI Desktop

enter image description here

Nope, the  [rollup test]  column does not return 5 for each of the 3 rows.  Why?

No doubt there is a missunderstanding in my "row context" knowledge.  But to me the [rollup test] calculated column clearly states:

  1. hit the entire ‘rollup test’ table again for each row

  2. sum that temporary table

Which gives result of 5 for each of the 3 row iterations.  Does it not?

This question posted in pbi community link

>Solution :

In a Calculated Column you will have Row Context, so you will only get that one row. To get the whole table then you’ll need to use ALL or other filter function to remove the row context.

Eg:

rollup test =
  SUMX (
    ALL('RollupTest'),
    'RollupTest'[child value]
  )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading