Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I have a dataset in which one record represents one sale. I have a datetime column and a calculated column 'hour' based on the datetime column. Let's say:
| ID | Date | Hour | Quantity | |
1  | 2022-08-20 09:00:00 | 
  | 9  | 2 | 
| 2 | 2022-08-20 09:30:00 | 9 | 3 | |
| 3 | 2022-08-20 09:40:00 | 9 | 4 | |
| 4 | 2022-08-23 09:00:00 | 9 | 2 | |
| 5 | 2022-08-24 09:00:00 | 9 | 4 | |
| 6 | 2022-08-24 9:20:00 | 9 | 6 | |
| 7 | 2022-08-24 12:10:00 | 12 | 3 | 
I also have a measure 'Number of sales' (calculated by taking the count of ID).
I would like to create 2 additional measures:
So that I could get a graph with on the x-axis the hours (from 0 to 24) and as values the above mentioned averages.
Hoping somebody could help
Best regards
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pibx file.
I suggest having a time table like the below.
Avg number of records: = 
AVERAGEX (
    ALL ( 'Calendar'[Date] ),
    CALCULATE ( COUNTROWS ( VALUES ( Data[ID] ) ) )
)
Avg number of Qty: = 
AVERAGEX (
    ALL ( 'Calendar'[Date] ),
    CALCULATE ( SUM(Data[Quantity] ) )
)
					
				
			
			
				Hi,
Please check the below picture and the attached pibx file.
I suggest having a time table like the below.
Avg number of records: = 
AVERAGEX (
    ALL ( 'Calendar'[Date] ),
    CALCULATE ( COUNTROWS ( VALUES ( Data[ID] ) ) )
)
Avg number of Qty: = 
AVERAGEX (
    ALL ( 'Calendar'[Date] ),
    CALCULATE ( SUM(Data[Quantity] ) )
)
					
				
			
			
				Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
            | User | Count | 
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | 
| User | Count | 
|---|---|
| 24 | |
| 11 | |
| 10 | |
| 9 | |
| 8 |