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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
109264
Frequent Visitor

Sales Total Based Upon Multiple Filters from Fields in a table

I have a sales fact table, customer and date table as seen below

 

I need to get the sales total for all customers who are active and sales total must for days later than the activation date, any help is appreciated

109264_0-1646699798939.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @109264 ,

 

I created an example based on the information you provided. The relationship is as follows.

vcgaomsft_1-1646882357101.png

vcgaomsft_0-1646882190032.png

Then please create a measure.

 

sales total = 
CALCULATE (
    SUM ( SALES[Amount] ),
    FILTER (
        ALL ( 'CUSTOMER' ),
        'CUSTOMER'[Status] = "Active"
            && MIN ( 'CUSTOMER'[Activation Date] ) < MIN ( 'SALES'[Transaction Date] )
    )
)

 

The result shows.

vcgaomsft_2-1646882473461.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @109264 ,

 

I created an example based on the information you provided. The relationship is as follows.

vcgaomsft_1-1646882357101.png

vcgaomsft_0-1646882190032.png

Then please create a measure.

 

sales total = 
CALCULATE (
    SUM ( SALES[Amount] ),
    FILTER (
        ALL ( 'CUSTOMER' ),
        'CUSTOMER'[Status] = "Active"
            && MIN ( 'CUSTOMER'[Activation Date] ) < MIN ( 'SALES'[Transaction Date] )
    )
)

 

The result shows.

vcgaomsft_2-1646882473461.png

Attach the PBIX file for reference. Hope it helps.

 

If this doesn't work for you, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

MattAllington
Community Champion
Community Champion

Delete the relationship btwn customer and calendar

you are using a Surrogate key, so mark your date table using "mark as date table"

why would you have sales before the activation date?

filter the visual based on active customers



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks Matt, we are analyzing pre program performance vs in program performance for each customer.

 

This needs to me a measure, not a filtered visual for each person's post active date sales purchase.

 

Any help is appreciated

Any filter that can be applied by a visual can be applied in a measure. 

measure = CALCULATE(sum(table[column]),Table[other column]="value")



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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.