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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filter a measure based on a condition on another measure

Hi there,

I have 2 facts based on 2 differents tables: SalesAmount and BudgetAmount.

I'd like to create a measure "SalesComparsion" which should consider "SalesAmount" only if the Customer (dimension joined to both facts), has a budget, this measure should work though I do not use the "customer" as detail in the analysis, for instance a monthly analysis.

 

How do I solve this?

Thank you

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Try this to find the Sale Amount:

Measure =
VAR _A =
    FILTER (
        ADDCOLUMNS (
            SALE,
            "Budget", LOOKUPVALUE ( BUDGET[AMOUNT], BUDGET[Customer_COD], SALE[Customer_COD] )
        ),
        [Budget] > 0
    )
RETURN
    SUMX ( _A, [AMOUNT] )

 

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

Appreciate your Kudos!!

 

View solution in original post

4 REPLIES 4
VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you add a sample of your data n a table format, and result?

 

Appreciate your Kudos!!

 

 

Anonymous
Not applicable

Hi @VahidDM ,

some screenshots: the relations of the 3 involved, data contained and the actual results.

ThanksRelationsRelationsDataDataResultsResults

Hi @Anonymous 

 

Try this to find the Sale Amount:

Measure =
VAR _A =
    FILTER (
        ADDCOLUMNS (
            SALE,
            "Budget", LOOKUPVALUE ( BUDGET[AMOUNT], BUDGET[Customer_COD], SALE[Customer_COD] )
        ),
        [Budget] > 0
    )
RETURN
    SUMX ( _A, [AMOUNT] )

 

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

Appreciate your Kudos!!

 

Anonymous
Not applicable

Great!

It's exactly what I war looking for.

Thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.