Forum Discussion

RustyD's avatar
RustyD
Frequent Visitor
2 years ago
Solved

Sum values from different columns and keep aggregated result

hi

I have a simple measure inside 1 table:

column A minus column B and it works fine on high level of aggregation. 

 

 

But the problem is that when I add more columns where some rows contains empty cells, the lines are split and the same happens with the calculation:

 

My expected result would be to get all lines 0 in this example.

 

thanks for any hints. 

  • Hello RustyD,

    You can change the measure like this,

    pbisup=
    IF(
    ISBLANK(SELECTEDVALUE(Tablesil1[B])) ||
    ISBLANK(SELECTEDVALUE(Tablesil1[P])),
    0,
    SUM(Tablesil1[B])-SUM(Tablesil1[P])
    )

    Kind Regards,
    Gökberk Uzuntaş

    📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

    🔗 Stay Connected:
    📘 Medium |
    📺 YouTube |
    💼 LinkedIn |
    📷 Instagram |
    🐦 X |
    👽 Reddit |
    🌐 Website |
    🎵 TikTok |




4 Replies

  • Hello RustyD,

    You can change the measure like this,

    pbisup=
    IF(
    ISBLANK(SELECTEDVALUE(Tablesil1[B])) ||
    ISBLANK(SELECTEDVALUE(Tablesil1[P])),
    0,
    SUM(Tablesil1[B])-SUM(Tablesil1[P])
    )

    Kind Regards,
    Gökberk Uzuntaş

    📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

    🔗 Stay Connected:
    📘 Medium |
    📺 YouTube |
    💼 LinkedIn |
    📷 Instagram |
    🐦 X |
    👽 Reddit |
    🌐 Website |
    🎵 TikTok |




  • RustyD's avatar
    RustyD
    Frequent Visitor

    hi uzuntasgokberk 

    thanks for this hint,  

     

    By the way the columns PO qty and GR qty are also measures.  So I simplified and omit the SELECTEDVALUE and it looks like only the IF with ISBLANK works : 

     

    Measure =
    IF(
    ISBLANK([PO qty]) || 
    ISBLANK([GR qty)]),
    0,
    [PO qty)]-[GR qty)]
    )
    • uzuntasgokberk's avatar
      uzuntasgokberk
      Icon for Super User rankSuper User

      Hello RustyD ,

       

      Great it has worked! Happy to hear that.

       

      Kind Regards,
      Gökberk Uzuntaş

      📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

      🔗 Stay Connected:
      📘 Medium |
      📺 YouTube |
      💼 LinkedIn |
      📷 Instagram |
      🐦 X |
      👽 Reddit |
      🌐 Website |
      🎵 TikTok |

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    Based on the description, if you have solved the problem, please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Wisdom Wu