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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Counting Instances of contact over a selectable date range, help!

I'm looking for a bit of help.  I'm new to using powerbi and come from a background on excel so as you can imagine, I'm having a little trouble adjusting.

 

I want to be able to select a date range and have a visual show me how often customers had to call me.

something like:-

 

1 call     =  "this many"

2 calls   =  "this many"

3 calls   =  "this many"

4 calls   =  "this many"

 

What I have so far is a table with all my call data with an identifier and date/time for each customer contact and a seperate table distinctly listing my identifiers.  I want to create a measure on the second table that will tell me how many times each of the distinct identifiers appears in the first table.  Idea being that when I select a date range on my visual, the measure on table 2 will adjust to count within that.  I feel as though I'm missing something very important though.

 

I've tried to do the following:-

 

 Measure = COUNTROWS( FILTER ('table1' , 'table1' [identifier] = 'table2' [identifier]))

 

This gives me the following error:

 

"A single value for column 'Account Number (Account)' in table 'Unique Accounts Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

I get a red underline under 'table2'[identifier] as well.

 

Anyone able to point me in the right direction with this one?

 

Thanks

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you try the formula below to see if it works.Smiley Happy

Measure =
IF (
    HASONEVALUE ( 'table2'[identifier] ),
    COUNTROWS (
        FILTER ( 'table1', 'table1'[identifier] = VALUES ( 'table2'[identifier] ) )
    ),
    COUNTROWS ( 'table1' )
)

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you try the formula below to see if it works.Smiley Happy

Measure =
IF (
    HASONEVALUE ( 'table2'[identifier] ),
    COUNTROWS (
        FILTER ( 'table1', 'table1'[identifier] = VALUES ( 'table2'[identifier] ) )
    ),
    COUNTROWS ( 'table1' )
)

 

Regards

Anonymous
Not applicable

Hi  v-ljerr-msft,

 

Thanks for for your suggestion.  This has worked but not the way I hoped.  When I come to filter by date on a visual using this measure, it doesn't re-adjust itself to look at only the data in table 1 between the 2 dates I select.  I'm maybe misunderstanding how measures work completely so I'll go back to the books and learn some more.

 

I can get the view I'm looking for now however if I were to now find away to create a new table from table 1 between date ranges which I'm sure I can work out.  I'll accept this one as answered and thank you once again for your help.

 

Kind Regards

 

Scottit

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.