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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Abrar786
Helper I
Helper I

Incorrect total for column in matrix

Hello,

I am getting an incorrect total for my measure. Please see below for the details of my measure.

 

Abrar786_0-1685313238465.png

 

 

Increase Sale =

VAR customers =
    FILTER (
        ADDCOLUMNS (
            DISTINCT ( invoices_details[customer_no] ),
            "@CYSale", [Total Sale],
            "@LYSale", [LY Sale],
            "@SaleDiff", [Total Sale] - [LY Sale]
        ),
        [@CYSale] > 0
            && [@LYSale] > 0
            && [@CYSale] > [@LYSale]
            && COUNTROWS (
                FILTER (
                    'category',
                    [@SaleDiff] >= 'category'[category min value]
                        && [@SaleDiff] < 'category'[category max value]
                )
            ) > 0
    )
   
RETURN
    SUMX ( customers, [@SaleDiff] )
 
Thank you in advance for the help.

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ahmedx
Super User
Super User

write another measure like this

SUMX ( VALUES('table'[category Name]), [Increase Sale] 
amitchandak
Super User
Super User

@Abrar786 , Try two measures like

 

Inc =COUNTROWS (
FILTER (
'category',
[@SaleDiff] >= 'category'[category min value]
&& [@SaleDiff] < 'category'[category max value]
)
)


Increase Sale =

Sumx(FILTER (
ADDCOLUMNS (
values ( invoices_details[customer_no] ),
"@CYSale", [Total Sale],
"@LYSale", [LY Sale],
"@SaleDiff", [Total Sale] - [LY Sale]
),
[@CYSale] > 0
&& [@LYSale] > 0
&& [@CYSale] > [@LYSale]
&& [Inc]> 0
),[@SaleDiff])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors