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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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