Balestier Streetkid
Balestier Streetkid

Reputation: 1

How to create a measure to count the number of times item appears in a filtered list (power BI, DAX)

enter image description here

Hi, I would like to create a measure in power BI to return the number of times the terminal code appears in my list. The list is filtered from a slicer when I select the service code.

Thanks for any help! been stuck at this seemingly simple problem for a few days!

Upvotes: 0

Views: 954

Answers (1)

msta42a
msta42a

Reputation: 3741

If you want to count occurence in selected filter context then use ALLSELECTED:

CountOfCode = CALCULATE( COUNTROWS(Sheet1), filter(ALLSELECTED(Sheet1), Sheet1[Terminal Code ] = SELECTEDVALUE(Sheet1[Terminal Code ]) ))

without filter

with filter

Upvotes: 1

Related Questions