cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors