Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
Hi @MrMichael ,
Based on your description, I have created a simple sample:
It seems that the results are the same:
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.
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |