The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
Solved! Go to Solution.
Hi @109264 ,
I created an example based on the information you provided. The relationship is as follows.
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.
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.
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
Hi @109264 ,
I created an example based on the information you provided. The relationship is as follows.
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.
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.
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
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
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")
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |