Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
komald
Helper I
Helper I

How to get correct total of measure

I have created measure which shows revised target for a sales person dc(distribution channel)wise but i'm getting measure total incorrect.

komald_0-1652079904753.png

 dax for revised target
revised target =

Revised_target =
CALCULATE(Sum(TargetBySalesPersonAll[Target_Amount]),TargetBySalesPersonAll[Revision_No]=MAX(TargetBySalesPersonAll[Revision_No]))
 
similar way i have written dax for initial target it gives me correct total
komald_1-1652080052139.pngInitial_Target=CALCULATE(Sum(TargetBySalesPersonAll[Target_Amount]),TargetBySalesPersonAll[Revision_No]=1) 
what's wrong  in revised_target dax ?

 

 

 

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @komald,

 

Measure will calculate and generate results per the calculation context. At the same time, the total of measure will do calculations as well and it may be impacted by the functions in your dax formula. So to make the total correct, you can simply create another Measure to help you correct the total.

CorrectTotal =
VAR midT =
    ADDCOLUMNS (
        TargetBySalesPersonAll,
        "Revised",
            CALCULATE (
                TargetBySalesPersonAll[Revised_target],
                VALUES ( TargetBySalesPersonAll[DCCode] )
            )
    )
RETURN
    SUMX ( midT, [Revised] )

 

Here are some blogs/links may help you better handle such kind of incorrect Measure total as well.

Solved: Measure total incorrect - Microsoft Power BI Community

Fixing Incorrect Totals Using DAX Measures In Power BI | Enterprise DNA

Power BI: Totals Incorrect and how to Fix it - Finance BI (finance-bi.com)

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how your tables look like, the relationships you create for them and how you create these two count measures. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @komald,

 

Measure will calculate and generate results per the calculation context. At the same time, the total of measure will do calculations as well and it may be impacted by the functions in your dax formula. So to make the total correct, you can simply create another Measure to help you correct the total.

CorrectTotal =
VAR midT =
    ADDCOLUMNS (
        TargetBySalesPersonAll,
        "Revised",
            CALCULATE (
                TargetBySalesPersonAll[Revised_target],
                VALUES ( TargetBySalesPersonAll[DCCode] )
            )
    )
RETURN
    SUMX ( midT, [Revised] )

 

Here are some blogs/links may help you better handle such kind of incorrect Measure total as well.

Solved: Measure total incorrect - Microsoft Power BI Community

Fixing Incorrect Totals Using DAX Measures In Power BI | Enterprise DNA

Power BI: Totals Incorrect and how to Fix it - Finance BI (finance-bi.com)

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how your tables look like, the relationships you create for them and how you create these two count measures. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

amitchandak
Super User
Super User

@komald , if you use row context you need build total using visual  context

 

refer example

 

Revised_target =

sumx( Addcolumns( summarize(table, Table[person id], table[reveison] ), "_1"
CALCULATE(Sum(TargetBySalesPersonAll[Target_Amount]),filter(allselected(TargetBySalesPersonAll), TargetBySalesPersonAll[Revision_No]=MAX(TargetBySalesPersonAll[Revision_No])) ), [_1])

 

 

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.