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
eddiechang
Helper I
Helper I

Matrix Table with Sales & Purchase by Supplier

Hi,

 

I looking for a solution to have a matrix table that shows:

 

After i select a supplier by slicer

 

1. Purchase measurement: How much i purchased from this supplier by product

2. Sales measurement: For those only product i purchased from this supplier, how much it sold regardless of customer

 

in data model:

bi_bill[DocType1] = "AR" is Sales

bi_bill[DocType1] = "AP" is Purchase

 

Enclosed with the pbix. Really wish any experts can clear my doubt. This stucked me for weeks.

Thanks.

 

pbix

 

 

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @eddiechang,

 

Could you try the formula below to see if it works in your scenario? Smiley Happy

Sales =
VAR currentProductName =
    FIRSTNONBLANK ( bi_product_master[ProductName], 1 )
RETURN
    CALCULATE (
        SUM ( bi_bill[FinalAmount] ),
        FILTER (
            ALLEXCEPT ( bi_bill, bi_bill[StoreNo], bi_bill[DocDate] ),
            RELATED ( bi_product_master[ProductName] ) = currentProductName
                && bi_bill[DocType1] = "AR"
        )
    )

 

Regards

Hi @v-ljerr-msft,

 

Thanks for the reply. Unfortutenately it not work.

[SalesAll] is the measurement i used as you provided.

 

Capture.PNG

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.