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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.