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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AnttiKoskinen
Frequent Visitor

Is a transaction date within 12 calendar months from a set date (boolean)

Hi!

 

I can't wrap my head around this one but I know the community can.

 

I have fact table with transactions and dim calendar which is connected to fact via date.

 

factfactdim calendardim calendar

 

I'd need a boolean in fact table which gives 1 if Data_transaction is within 12 calendar months from Reporting Date (images are illustrations of what I'd need, unfortunately not the tables I've managed to produce).

 

Could you help me out with a solution which solves this?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

=IF([Date_Transaction]>EDATE([Reporting Date],-12) && [Date_Transaction]<=[Reporting Date],1,0)

 

= IF([Date_Transaction] IN CALENDAR(EDATE([Reporting Date],-12)+1,[Reporting Date]),1,0)

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

=IF([Date_Transaction]>EDATE([Reporting Date],-12) && [Date_Transaction]<=[Reporting Date],1,0)

 

= IF([Date_Transaction] IN CALENDAR(EDATE([Reporting Date],-12)+1,[Reporting Date]),1,0)

Fantastic! Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.