Forum Discussion

M_SBS_6's avatar
M_SBS_6
Helper V
4 years ago
Solved

Total on table is incorrect

Hi, I have the following logic which totals each row correctly, but the grand total is way out, and I have no idea why. Any idea why this could be, please? 

 

Value =

if(apps[spend] <=300000, apps[spend] * apps[300_int_pc],

 

if(apps[spend] >300000 && apps[spend] <=400000, apps[spend] * apps[400_int_pc],

 

if(apps[spend] >400000 && apps[spend] <=500000, apps[spend] * apps[500_int_pc],

 

if(apps[spend] >500000, apps[spend] * apps[500over_int_pc],0))))

 

  • Hi, M_SBS_6 ;

    Are [300_int_pc],[400_int_pc],[500_int_pc],500over_int_pc],  measure? I tested this funtion by a simple example.and when this dax apply into my column. the total is right.

    The final show:

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • M_SBS_6 , Push ar row level

     

    Sumx(apps ,

    if(apps[spend] <=300000, apps[spend] * apps[300_int_pc],

     

    if(apps[spend] >300000 && apps[spend] <=400000, apps[spend] * apps[400_int_pc],

     

    if(apps[spend] >400000 && apps[spend] <=500000, apps[spend] * apps[500_int_pc],

     

    if(apps[spend] >500000, apps[spend] * apps[500over_int_pc],0)))) )

     

    or you have uses values, Summarize to group it

    refer https://www.youtube.com/watch?v=ufHOOLdi_jk

     

    • M_SBS_6's avatar
      M_SBS_6
      Helper V

      Thanks for your suggestion, but unfortunately, I still get the incorrect total amount. 

      I have watched the video in the link that you sent, still not completely clear as I'm so new to Power BI.

       

      Do I essentially need to include HASONEFILTER somewhere into this logic? 

      • amitchandak's avatar
        amitchandak
        Super User

        M_SBS_6 ,
        Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, M_SBS_6 ;

    Are [300_int_pc],[400_int_pc],[500_int_pc],500over_int_pc],  measure? I tested this funtion by a simple example.and when this dax apply into my column. the total is right.

    The final show:

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.