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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
iluvcoding_91
Helper I
Helper I

DAX - Filter a FACT table based on an attribute (field) from another FACT table

Hello, so I have two FACT tables and three DIM tables. FACT table one (orders) has a monthly level of granularity, while FACT table two (sales) has a daily level of granularity. Both FACT tables are related via the three DIM tables up top. I'm trying to find a way to sum the orders in the Orders FACT table based on an attribute that exists in the Sales FACT table (this attribute does not exist in any of the DIM tables, it only exists in the Sales FACT table). Is there a way I can use DAX to calculate the total orders by customer based on this attribute that only exists in the sales table? For example, sum the orders for customers where the Sales attribute equals "true"?

iluvcoding_91_0-1651270306618.png

 

1 REPLY 1
Anonymous
Not applicable

Hi!

With the information provided I think you could create a calculated column in the customer dimention table. If this is the model:

marisolmarch_0-1651312059684.png

And this is the Fact Sales:

marisolmarch_4-1651313772019.png

 

As you can see I created different line of Sales for the customer 03, assuming that the flag can change for the same customer.

 

To give True if at least one of the Sales rows for the customer is true, create the calculated column:

Sales Flag = CALCULATE(MAX(Sales[Flag]), RELATEDTABLE(Sales))

marisolmarch_2-1651313422153.png

Otherwise, if you want to give false if at least one row is false:

Sales Flag = CALCULATE(MIN(Sales[Flag]), RELATEDTABLE(Sales))

 

Once you have this flag just calculated the measure like:

Measure for customer True = CALCULATE([Measure], Customer[Sales Flag] = 1)

 

I hope I answered your question,

Have a good day,

 

Marisol

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.