Forum Discussion
Calculated Column from another fact table without relationship
- 4 years ago
Hi DIACHROMA,
You may try this Measure.
Sales D+30? = CALCULATE ( COUNT ( Sales[OrderDate] ), //Count Order in the Range TREATAS ( VALUES ( 'Events Attendees'[Attendee] ), Sales[Customer] ), FILTER ( 'Calendar', 'Calendar'[Dates] >= MINX ( 'Events Attendees', 'Events Attendees'[EVENT DATE] ) && 'Calendar'[Dates] <= MINX ( 'Events Attendees', 'Events Attendees'[DAYS +30] ) ) )Then, the result will look like this.
Also, attached the pbix file as reference.
If this 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 me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
DIACHROMA it is pretty straightforward since you have the model already in place, just add the following measure:
Sales D+30 New? =
VAR __numberOfDays = 30
VAR __eventStartDate = MIN ( 'Events Attendees'[Event Date] )
VAR __eventEndDate = __eventStartDate + __numberOfDays
RETURN
CALCULATE (
COUNTROWS ( Sales ),
DATESBETWEEN (
'Calendar'[Dates],
__eventStartDate,
__eventEndDate
)
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.