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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Collins26390
Frequent Visitor

Calculate number of Visits Per Day

Hello,

 

I am trying to create a visual to demonstrate the number of visits that my engineers have completed over time. This should allow me to add slicers to do some analysis based on visits per location, per engineer etc. I have added a RealTimeData table from a streaming dataset to my Power BI report, which contains details of the location, engineer, date/time of last visit etc.

 

I have experimented with various DAX expressions to show how the visit numbers fluctuate over time, but so far I have been unsuccessful. 

 

Collins26390_0-1699445592534.png

Based on the data above, what I want to show is that there were 10 visits on 22/09/2023, 1 on 25/09/2023, 18 on 26/09/2023 and so on.

 

Any assistance would be greatly appreciated!

5 REPLIES 5
Dangar332
Super User
Super User

Hi, @Collins26390 

try below code
just adjust your table and column name

 

result =
  SUMX(
     FILTER(
        'Tablename',
         'Tablename'[date]=MAX('Tablename'[date])
     ),
     'Tablename'[visits]
   )

 

Hi @Dangar332 ,

 

Thank you for coming back to me. I've tried implementing your solution, but I'm a little confused about which column 'Tablename'[visits] should correspond to. PSB a sample of the table I'm working on:

 

Collins26390_0-1699464445688.png

I've tried using [Last Visit] with your formula, but it just seems to be replicating the information that is already in that column.

 

Thanks

Hi, @Collins26390 
try below

result =
calculate(
    sum('Tablename'[visits]), 
    'Tablename'[last visit]=MAX('Tablename'[last visit]),
    allexcept('tablename','tablename'[last visit])
  )
  

@Dangar332 ,

 

Sorry, that doesn't work. I don't have a 'visits' column, only the ones listed above.

HI, @Collins26390 

try below

visit count=
  calculate(
      count('tablename'[last visit]),
      allexcept('tablename','tablename'[last visit])
   )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors