Forum Discussion

HvdSteen's avatar
HvdSteen
Regular Visitor
1 year ago
Solved

Total in table visual not showing

I cant seem to figure this problem out. I have a pbi table visual and i want to total my column 'waarde'. (so here it should sum to 26) There are some filters in the dashboard so 'id', 'regio' and 'waarde' come from the source table. and my measure should give the same result as the 'waarde' column, only with totals at the botom. But i cant seem to figure out what measure i need to use, and i dont understand what my wrong measure is showing, where it gets its values from.

This is the measure i tried

Val klachten = CALCULATE(sum(ID_Fysieke_klachten[Waarde]),filter(ID_Fysieke_klachten,ID_Fysieke_klachten[Regio]=ID_Fysieke_klachten[Regio]))

 

Thanks to whoevever is smarter than me

H.

  • Hi HvdSteen,

    at the moment the column [Waarde] of the visual corresponds to a column grouped in the rows section, right?

     

    I would suggest to create a measure for that

     

    Waarde total = SUM ( ID_Fysieke_klachten[Waarde] )

     

    I might be wrong but this seems to me the simplest solution

     

    Best

     

    If this helped, please consider giving kudos and mark as a solution

    @me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

9 Replies

  • Hi HvdSteen,

    at the moment the column [Waarde] of the visual corresponds to a column grouped in the rows section, right?

     

    I would suggest to create a measure for that

     

    Waarde total = SUM ( ID_Fysieke_klachten[Waarde] )

     

    I might be wrong but this seems to me the simplest solution

     

    Best

     

    If this helped, please consider giving kudos and mark as a solution

    @me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

    • HvdSteen's avatar
      HvdSteen
      Regular Visitor

      I tried that, it gives the same wrong values as my current measure. 

      • FBergamaschi's avatar
        FBergamaschi
        Icon for Super User rankSuper User

        Weird, then we need to see the model

         

        Can you share the pbix via some coud sevice and paste here th elink or the paste the table from which you are taking the data here (in a usable format), so we recreate the visual?

         

        If this helped, please consider giving kudos and mark as a solution

        me in replies or I'll lose your thread

        Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

        Consider voting this Power BI idea

        Francesco Bergamaschi

        MBA, M.Eng, M.Econ, Professor of BI

        Thanks

  • Hi HvdSteen 

    Create a simple SUM measure and use that in the visual instead of the raw column.

    Val klachten =
    SUM ( ID_Fysieke_klachten[Waarde] )

     

    Then:

    • Put Id and Regio in Rows.
    • Add the measure Val klachten into Values (not the Waarde column).
    • Keep Totals = On in the Format pane.

     

    Now each row will show the right number and at the bottom the total (26 in your example).
    If you have duplicate Regio values and still want the total to match the visible rows, you can use this version:

    Val klachten (safe) =
    SUMX (
       VALUES ( ID_Fysieke_klachten[Regio] ),
       CALCULATE ( SUM ( ID_Fysieke_klachten[Waarde] ) )
    )

     

    This way the total in the table will always match the visible data. 

  • Hi HvdSteen

     

    If 'Waarde' is already row-level (looks like it is not aggregated) , then the measure would be:

    Measure= SUM ( ID_Fysieke_klachten[Waarde] )

    • HvdSteen's avatar
      HvdSteen
      Regular Visitor

      So i thought, but it gives the wrong results and i dont know why. 

  • HvdSteen's avatar
    HvdSteen
    Regular Visitor

    i dont understand what you mean by 'grouped in rows' though,... this is the lowest level of data, so the value in 'waarde' is the actual value from the source table, not a sum of anything. 

  • HvdSteen's avatar
    HvdSteen
    Regular Visitor

    I figured it out, for some reason there were duplicate rows in my source table,.. thats why all the values were off. Now my old measure and all you guys sugessted work like it should work!