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

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

Reply
reemadsouza
Frequent Visitor

Averages not showing properly

I have this measure :-

 

row context avg =
AVERAGEX(
    FILTER(
        'Ticket Times',
        NOT(ISBLANK('Ticket Times'[Trip Time (s)]))
    ),
    'Ticket Times'[Trip Time (s)] / 60
)
 and another way to write the same 
Column context avg = CALCULATE(DIVIDE([Trip Time (min)],[Ticket Count without Blanks]))
 
where 
Ticket Count without Blanks =
CALCULATE(
    DISTINCTCOUNT('Ticket Lines'[Ticket Number]),
    FILTER('Ticket Times'NOT(ISBLANK('Ticket Times'[Trip Time (s)])))
)
 
for 3 days it gives me these values 
 reemadsouza_0-1725385179736.png

 

 

 when I average in excel I get reemadsouza_1-1725385179499.png

 

  how do i get my pbi measuire to match 145.75388 avg instead of 145.788

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @reemadsouza ,

I create a table as you mentioned.

vyilongmsft_0-1725418390046.png

Then I create a new table and here is the DAX code.

Table 2 = 
SUMMARIZE(
    'Table', 
    'Table'[ID], 
    "TotalCount", SUM('Table'[Count])
)

vyilongmsft_1-1725418757630.png

So you can calculate what you want.

Average = AVERAGE('Table 2'[TotalCount])

vyilongmsft_2-1725419116095.pngvyilongmsft_3-1725419265727.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
vivek31
Resolver II
Resolver II

Hii, @reemadsouza

 

you can try this,

 

first sum of count

total count = SUM('Table (3)'[count])

 

second avg the total count,

avg = AVERAGEX(VALUES('Table (3)'[id]),[total count])

 

vivek31_0-1725518605489.png

 

 

 

 

Anonymous
Not applicable

Hi @reemadsouza ,

I create a table as you mentioned.

vyilongmsft_0-1725418390046.png

Then I create a new table and here is the DAX code.

Table 2 = 
SUMMARIZE(
    'Table', 
    'Table'[ID], 
    "TotalCount", SUM('Table'[Count])
)

vyilongmsft_1-1725418757630.png

So you can calculate what you want.

Average = AVERAGE('Table 2'[TotalCount])

vyilongmsft_2-1725419116095.pngvyilongmsft_3-1725419265727.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ahadkarimi
Solution Specialist
Solution Specialist

Hi @reemadsouza, give this measure a try, and if you encounter any issues, let me know.

 

Corrected Avg = 
VAR TotalTimeInMinutes = SUMX(
    FILTER(
        'Ticket Times',
        NOT(ISBLANK('Ticket Times'[Trip Time (s)]))
    ),
    'Ticket Times'[Trip Time (s)] / 60
)

VAR NonBlankTicketCount = 
    CALCULATE(
        DISTINCTCOUNT('Ticket Lines'[Ticket Number]),
        FILTER('Ticket Times', NOT(ISBLANK('Ticket Times'[Trip Time (s)])))
    )

RETURN
DIVIDE(TotalTimeInMinutes, NonBlankTicketCount)

Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Supplier!

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.