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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
viesturs
Regular Visitor

time intelligence power bi date functions not working with measures as arguments

I have a table TNS_dati with sales volumes [Cena Euro] and date column [Datums / Periods] and related calendar table "calender" as date table. I am trying to calculate sales for all the period except the last month and found very tricky thing :

 

1. when I am harcoding the date : 

Vecie klienti = CALCULATE(
              SUM(TNS_dati[Cena EURO]),
               FILTER(
                   Calender,
                 //   TNS_dati[Datums / Periods] < DATE(YEAR(max(TNS_dati[Datums / Periods])),3,1)
                       Calender[Date] < date(2023, 2,29)
                //  DATESBETWEEN(TNS_dati[Datums / Periods], blank(), max(TNS_dati[Datums / Periods])
                  //  DATESINPERIOD(Calender[Date], min(Calender[Date]),13,MONTH)
                     )
            )
It works perfectly and returns what I am looking for, but when I am using a measure (for instance for year = 
 YEAR(max(Calender[Date])), It returns for 2023 ok but for all the previous years only Jan, Feb.
 
Could someone explain why it is so and how to solve it?
 
 
 
1 ACCEPTED SOLUTION
viesturs
Regular Visitor

Solved by myself. 

View solution in original post

1 REPLY 1
viesturs
Regular Visitor

Solved by myself. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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