Forum Discussion

PWRBI's avatar
PWRBI
Frequent Visitor
3 years ago
Solved

Summarize in DAX, HELP :)

I have the following data:

Dimension1, Dimension2, Value1, and Value2. Now, I want each row to be calculated first in Power BI (PBI), and then the sum of all individual positions from Dimension2 should be added for Dimension1.

 

Here's how it should look:

Dimension 1Dimension 2Wert 1Wert 2Ergebnis
AAA15= 1/5 --> 0,2
ABB1010= 10/10 --> 1
ATotal  

= 1,2

 

But that's how it looks in PBI:

Dimension 1Dimension 2Wert 1Wert 2Ergebnis
AAA15= 0,2
ABB1010= 1
ATotal  

= 0,73

 

I've already tried Summarize with no success. Can you help me please?

  • Hi PWRBI ,
    If I understand your issue correctly, you might try this.

    Column = IF(Summary[Dim2]="Total",Sumx(Summary,Divide(Summary[Val1],Summary[Val2])),Divide(Summary[Val1],Summary[Val2]))


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel





6 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi PWRBI ,
    If I understand your issue correctly, you might try this.

    Column = IF(Summary[Dim2]="Total",Sumx(Summary,Divide(Summary[Val1],Summary[Val2])),Divide(Summary[Val1],Summary[Val2]))


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel





    • PWRBI's avatar
      PWRBI
      Frequent Visitor

      No, unfortunately it doesn't work, it's not what I expect. Total is not a dimension, but the total line of Power BI, where the sum must be calculated correctly

      • Nathaniel_C's avatar
        Nathaniel_C
        Icon for Community Champion rankCommunity Champion

        Hi PWRBI ,
        If I understand your issue correctly, you might try this - it was not clear in your picture.
        Add a column to your table and add it to the visual.
        If this is not what you wanted, please add some more explanation.

        Column = Divide(Summary[Val1],Summary[Val2])

        Original table


        With Calculated Column

        In Visual


        Let me know if you have any questions.

        If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
        Nathaniel



  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi PWRBI ,

    How do you get 38,516.78 on the first row based on this formula.  If you wish me to look at this please include an explanation of what you are trying to do and make your example much clearer than what you did here.  Otherwise you may want to re post this.

    Thank you,

     

    Nathaniel

    • PWRBI's avatar
      PWRBI
      Frequent Visitor

      Hi, how can I Upload a PBI File for you with an example?