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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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