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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
george_p
Frequent Visitor

Tracking effect of a change in the fact table

Hi all,

 

In my sales fact table, I have a column that indicates an event at a certain date. What I want to do is to take this date and compare my sales three days before and after this event. How can I achieve this?

1 ACCEPTED SOLUTION

@Anonymous,

 

Thanks for the suggestion. What you proposed is not suitable for my model since I have more than one events in my Event column and want to have the measures for all my events. Meanwhile, I solved this myself by changing my model. I created a separate table for my events and in that table, I added columns for the "beforetest" and "aftertest".

 

Thanks for the hint though.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@george_p,

I make a test using the following sample  table(Table5), create the measures below.
1.JPG

testdate = CALCULATE(MAX(Table5[Date]),FILTER(Table5,Table5[Event]="test"))
beforetest = CALCULATE(SUM(Table5[Sales Amount]),DATESBETWEEN(Table5[Date],[testdate]-3,[testdate]-1))
aftertest = CALCULATE(SUM(Table5[Sales Amount]),DATESBETWEEN(Table5[Date],[testdate]+1,[testdate]+3))


If the above steps don't help, please share dummy data of your table and post expected result.

Regards,
Lydia

@Anonymous,

 

Thanks for the suggestion. What you proposed is not suitable for my model since I have more than one events in my Event column and want to have the measures for all my events. Meanwhile, I solved this myself by changing my model. I created a separate table for my events and in that table, I added columns for the "beforetest" and "aftertest".

 

Thanks for the hint though.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors