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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
lmundia
Frequent Visitor

Append a filtered value to another value

I have a variance value generated from past months and I need to append it to future months, how can I do it in DAX, when I do CALCULATE(future_month_value+variance_from_past_months) my variance is set to 0 because the future months dont have a variance. I have tied to assign the variance to value measure measure = value(variance_from_past_months) that didnt help. 

 

Please help

 

Thank you

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@lmundia

 

 

In this scenario, I assume you want to assign the last non empty variance to your future months. You need to get the max date for all non empty variance entries. Then get the last non empty variance. It can be like: 

 

=
VAR MaxDate =
    CALCULATE (
        MAX ( Table[Date] ),
        FILTER ( ALL ( Table ), Table[Variance] <> BLANK () )
    )
RETURN
    CALCULATE (
        SUM ( Table[Variance] ),
        FILTER ( ALL ( Table ), Table[Date] = MaxDate )
    )

View solution in original post

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@lmundia

 

 

In this scenario, I assume you want to assign the last non empty variance to your future months. You need to get the max date for all non empty variance entries. Then get the last non empty variance. It can be like: 

 

=
VAR MaxDate =
    CALCULATE (
        MAX ( Table[Date] ),
        FILTER ( ALL ( Table ), Table[Variance] <> BLANK () )
    )
RETURN
    CALCULATE (
        SUM ( Table[Variance] ),
        FILTER ( ALL ( Table ), Table[Date] = MaxDate )
    )
Abduvali
Skilled Sharer
Skilled Sharer

Hi @lmundia,

 

When you say a future month, how many months do you mean???

 

Regards

Abduvali

my fiscal year ends in February, thus another 3 months

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.