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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dancarr22
Helper V
Helper V

FILTER in DAX measure not working properly -- when there are 2 filters

Hello,

 

I am using Power BI/DAX to calculate linked returns for a portfolio.

We have 2 different return fields -- one for daily return and one for monthly returns.

Theoretically, they should return the same value.

The DAX formulas are almost exactly the same except the MTD has an additional FILTER -- where IsMTD=TRUE

 

THIS WORKS

msr_LinkedReturn_Daily = VAR DATECOL= MAX(AccountReturn[AccountReturn_AsOfDate])
RETURN (CALCULATE(
        PRODUCT(
          AccountReturn[calc_Return_Daily]
            ),
            FILTER(
               AccountReturn,
                AccountReturn[AccountReturn_AsOfDate]<=DATECOL )
               )-1)

 

THIS DOES NOT WORK

msr_LinkedReturn_MTD = VAR DATECOL= MAX(AccountReturn[AccountReturn_AsOfDate])
RETURN (CALCULATE(
        PRODUCT(
          AccountReturn[calc_Return_MTD]
            ),FILTER(AccountReturn,AccountReturn[IsLastDayOfMonth]=TRUE),
            FILTER(
               AccountReturn,
                AccountReturn[AccountReturn_AsOfDate]<=DATECOL )
               )-1)

 The only real difference between these 2 formulas (besides a different field value being used) is the MTD has 2 filter fields -- the daily only has one.  The additional filter in MTD is: FILTER(AccountReturn,AccountReturn[IsLastDayOfMonth]=TRUE),

 

The MTD does sometimes work when I only rollup for a few portfolios -- but when I select more than 3 or 4 everything gets set to -100%.

 

Any help you can offer is greatly appreciated.

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Hi Lydia,

 

Thanks for your response.

The field was a boolean (true/false).  I found the error was in setting the variable at the start of the function.  That was not required as that filter was already applied by defualt.

So, this issue has been resolved.  Was user error.

 

Thanks,

Dan

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@dancarr22,

What is the data type of IsLastDayOfMonth field? Is it text or True/False? You need to change the additional FILTER formula to the following if it is text:

FILTER(AccountReturn,AccountReturn[IsLastDayOfMonth]="TRUE")

If the above step doesn't help,  please share sample data of the AccountReturn table here.

Regards,
Lydia

Hi Lydia,

 

Thanks for your response.

The field was a boolean (true/false).  I found the error was in setting the variable at the start of the function.  That was not required as that filter was already applied by defualt.

So, this issue has been resolved.  Was user error.

 

Thanks,

Dan

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors