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
ancorte
Frequent Visitor

CALCULATE A VALUE GROUPING FROM OTHER TABLE

Hi, i've a fact table with Product Quantity Price, Customer, and so on. I have a table with Product, and another with Customer.

I try to have a measure that give me the Value of all product sold, when the total quantity of product sold (for all customers) is less than a certain value.

Tha fact tabel has this columns:

Customer, Date, CodeArticle, UnitPrice, Quantity, Total Price

I tried with this measure

CALCULATE(SUM(FT[PrezzoTotale]),
FILTER( FT, SUM(FT[Quantita])<100))
and if this measure is in the table with the Products(on the rows) it's all ok: but i want only a total value.
 
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @ancorte ,

According to your description, if CodeArticle in fact table represents product, here's my solution.

Here's my sample.

vkalyjmsft_0-1654227233395.png

Create a measure.

Measure =
SUMX (
    FILTER (
        'FT',
        SUMX (
            FILTER ( 'FT', 'FT'[CodeArticle] = EARLIER ( FT[CodeArticle] ) ),
            'FT'[Quantity]
        ) < 100
    ),
    'FT'[Total Price]
)

Get the correct result.

vkalyjmsft_1-1654227291200.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @ancorte ,

According to your description, if CodeArticle in fact table represents product, here's my solution.

Here's my sample.

vkalyjmsft_0-1654227233395.png

Create a measure.

Measure =
SUMX (
    FILTER (
        'FT',
        SUMX (
            FILTER ( 'FT', 'FT'[CodeArticle] = EARLIER ( FT[CodeArticle] ) ),
            'FT'[Quantity]
        ) < 100
    ),
    'FT'[Total Price]
)

Get the correct result.

vkalyjmsft_1-1654227291200.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

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.