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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Syndicate_Admin
Administrator
Administrator

Generate a filtered Measure from two Measures and/or specific condition

Hello

I am wanting to generate a measure derived from another, based on Total Sales (previous measure) but now another, associated with products with Profit Margin (another measure) greater than 35%, and where sales do not correspond to products with this condition, which places $ 0. What dictates my understanding is that it should be Measure = CALCULATE([Total Sales], FILTER(Measures,Measures[Profit Margin]>=0.35))), however, under this formula Total Sales are being returned without being affected by the filter. Could you help me with the error or guide me with a suitable solution? The idea with this measure is to generate a column chart where total sales are displayed, how much corresponds to the number of products with the highest margin.

RAFAJRO_0-1680177527057.png

Thank you for the support and guidance.

1 REPLY 1
johnt75
Super User
Super User

You need to create a summary table which can be used as a filter, but you first need to determine at what granularity you want to measure the profit margin. If it is over the entire life of the product you could do something like 

Sales High Margin =
CALCULATE (
    [Total Sales],
    FILTER ( VALUES ( 'Sales'[Product ID] ), [Profit Margin] >= 0.35 )
)

but if you wanted to calculate profit margin at the product and year grain it would be something like

Sales High Margin =
CALCULATE (
    [Total Sales],
    FILTER (
        SUMMARIZE ( 'Sales', 'Sales'[Product ID], 'Date'[Year] ),
        [Profit Margin] >= 0.35
    )
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.