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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pedroccamaraDBI
Post Partisan
Post Partisan

TOTAL sales last 20 years

Hello all
I hope everyone's ok
I need to know the sum of sales for all years until 2020.
Capture.JPG
My Dates table has only dates from 1/1/2020. My fact table has dates since 2000. And they're both connected through dates.
It should be simple but a simple measure like this is not working:


CALCULATE
(
[Sales],
[SalesDate] <= 31/12/2020 )


I believe i can't do it other way because my dates table hasn't all dates, you know, since 2000
Can you help?
Thanks in advance

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Not sure if this would work but you can try

Sales before 2020 = CALCULATE( [Sales], TREATAS( { BLANK() }, 'Date'[Date]) )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Not sure if this would work but you can try

Sales before 2020 = CALCULATE( [Sales], TREATAS( { BLANK() }, 'Date'[Date]) )

Very good. Thanks a lot

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors