Forum Discussion
Visual Level Filter ignored by Measure
I have the below set up (see image). The 934 number is from a measure:
_MeasureTotalSelected = COUNTROWS(VALUES(CUSTOMER))
It's obvious that the 934 does not correlated with the count of the rows in the visual. If I add any slicer on to the page (like the "Active" one), then that slicer is reflected in the total, however, all the visual level filters are just not applied. How can I make the visual level filters apply to the measure?
12 Replies
- AnonymousNot applicable
Anonymous Is it possible that you need a DISTINCTCOUNT here instead? Power BI will aggregate the visual context to only show the unique rows. Does your raw dataset include that many rows for active customers?
- AnonymousNot applicable
I have made a repro of my scenario - I know what I have in there is not correct to do the job, but I don't know what I need to add in. There is a PBIX here, and a screen shot below.
When I move the date slider, the total CountOfMatches adjusts accoringly using the measure below. All happy.
EndedContracts = CALCULATE(COUNTROWS(Contracts))
However, when I update the visual level filter on the EndedContracts to only show those dates with less than two ended contracts, the total does not adjust acctoringly. How do I get the CountOfMatches measure to consider the visual level filter applied to the EndedContracts measure?
As per the screen shot below, when I add the filter of < 2 to Ended Contracts, I want the CountOfMatches to become 2.
- Ashish_MathurSuper User
Hi,
In my opinion you should not be dragging Ended Matches to the visual filters. You should instead be dragging Customer there. Check the box for specific cutomers and you figure will recompute. Also, you do not need the CALCULATE() function there. Just this will work
=COUNTROWS(Contracts)
- AnonymousNot applicable
HI Anonymous,
If you want to enable the visual level filter effect, you can try to combine use allselected and countrows functions.
For example:
_MeasureTotalSelected = COUNTROWS ( ALLSELECTED ( CUSTOMER ) )
BTW, I'm not so sure above formula works if you drag other table column as the filter of current visual.
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
I have the same scenario and none of the above has worked.
I have two measures. One factors in the visual level filters and the other does not. Why is this?
Works with visual level filters:
Total Searches = COUNT('Usage Statistics'[ID])Does not work with visual level filters:
2017-06 = CALCULATE(COUNTROWS('Usage Statistics'), 'Usage Statistics'[Created] >= date(2017,06,01), 'Usage Statistics'[Created] < date(2017,7,01))Why does the first one factor in visual level filters but the second one does not?
- AnonymousNot applicable
Hello,
Does anybody get a solution for this issue?
Regards,
Parag