Forum Discussion
Measure not abiding by filters
- 1 year ago
Gotcha, I missed that part!
I think the KEEPFILTERS function should do the trick. Something like:PCAP Amount Match =VAR _Table1 = CALCULATE(SUM(Table1[Amount]), KEEPFILTERS(Table1[FieldA]))
VAR _Table2 = CALCULATE(SUM(Table2[PCAP Amount]), KEEPFILTERS(Table2[FieldA]))returnIF(ROUND(_Table1, 2) = ROUND(_Table2,2), "Match", "Break")
I think adding a function to consider whether the Amount fields are null would do the trick. The below wouldn't produce a result if either _Table1 and _Table2 aren't null. Replace the || with && if you want to only produce a result where both _Table1 and _Table2 have a value.
PCAP Amount Match =
VAR _Table1 = SUM(Table1[Amount])
VAR _Table2 = SUM(Table2[PCAP Amount])
RETURN
IF(
ISBLANK(_Table1) || ISBLANK(_Table2),
BLANK(),
IF(ROUND(_Table1, 2) = ROUND(_Table2, 2), "Match", BLANK())
)
ArtisanAmbrosia thanks for the reply! The problem is, some of the all blanks further down in the table I want to keep, so it's not as simple as just filtering out the blanks (as stated above). I need it to review the filter and act accordingly (if possible). Is there somewhere I can incorporate that filter into the measure? It doesn't sees so because the filter reviews each row, there is no aggregation expression in it.
- ArtisanAmbrosia1 year agoFrequent Visitor
Gotcha, I missed that part!
I think the KEEPFILTERS function should do the trick. Something like:PCAP Amount Match =VAR _Table1 = CALCULATE(SUM(Table1[Amount]), KEEPFILTERS(Table1[FieldA]))
VAR _Table2 = CALCULATE(SUM(Table2[PCAP Amount]), KEEPFILTERS(Table2[FieldA]))returnIF(ROUND(_Table1, 2) = ROUND(_Table2,2), "Match", "Break")