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! Learn more

Reply
MrMichael
Frequent Visitor

Filter expression vs Boolean filters in calculatetable yields different results

The purpose of this question is to understand the filter context of calculatetable. 

Problem statement:
I have a table (MyTable) of descriptions and a month for the given description. 
And would like to return how many times a given description repeats within a month

Solutions:
 * Solution that works:
var MonthDescriptionTable  = CALCULATETABLE(MyTable,
       FILTER(MyTable,
MyTable[DESCRIPTION]=EARLIER(MyTable[DESCRIPTION]) && MyTable[MONTH] = EARLIER(MyTable[MONTH])
        )
)

return COUNTROWS(MonthDescriptionTable)

* Solution that does not work:
var MonthDescriptionTable = CALCULATETABLE(MyTable,MyTable[DESCRIPTION]=EARLIER(MyTable[DESCRIPTION]) &&MyTable[MONTH] = EARLIER(MyTable[MONTH]))

return COUNTROWS(MonthDescriptionTable)

To sum up; how come the boolean filter does not work compared to the filter expression? 

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @MrMichael ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1679623600623.png

It seems that the results are the same:

vjianbolimsft_1-1679623640737.png

vjianbolimsft_2-1679623650702.png

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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