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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
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.