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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
brockry1
Helper II
Helper II

DAX Code to Sum a Measure by row vs total

I am building a new dashboard for my team and I have hit a few hurdles in the DAX commands.  I am looking to be able to show a KPI Card to sum up the individual rows compared to the growth %.  Currently it is using the logic to only show the growth % total.  

 

This is the formula I am currently using:

Rebate Earned = IF([Current Year]>=1250,

IF([Rebate %]>0,

CALCULATE([Rebate %]*[Current Year])))
 
It looks correct in the table version:  
 
brockry1_0-1733767469276.png

 

 

 

However this is what is showing in the KPI Card:

brockry1_1-1733767468910.png

 

 

Is there a better way of writing the DAX code to be able to sum this vs comparing to the total growth %? 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @brockry1 ,

According to your description, you want to show the sum of Earned in the card view, right? We can use sumx instead of calculate, sometimes calculate affects the normal aggregation.

 

Rebate Earned = 
SUMX(
    'Table',
    IF(
        [Current Year] >= 1250 && [Rebate %] > 0,
        [Rebate %] * [Current Year],
        0
    )
)

 

vxingshenmsft_0-1733794275452.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @brockry1 ,

According to your description, you want to show the sum of Earned in the card view, right? We can use sumx instead of calculate, sometimes calculate affects the normal aggregation.

 

Rebate Earned = 
SUMX(
    'Table',
    IF(
        [Current Year] >= 1250 && [Rebate %] > 0,
        [Rebate %] * [Current Year],
        0
    )
)

 

vxingshenmsft_0-1733794275452.png

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

brockry1
Helper II
Helper II

I am building a new dashboard for my team and I have hit a few hurdles in the DAX commands.  I am looking to be able to show a KPI Card to sum up the individual rows compared to the growth %.  Currently it is using the logic to only show the growth % total.  

 

This is the formula I am currently using:

Rebate Earned = IF([Current Year]>=1250,

IF([Rebate %]>0,

CALCULATE([Rebate %]*[Current Year])))
 
It looks correct in the table version:  
 
brockry1_0-1733762610698.png

 

 

However this is what is showing in the KPI Card:

brockry1_1-1733762646129.png

 

Is there a better way of writing the DAX code to be able to sum this vs comparing to the total growth %? 

 

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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