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
Anonymous
Not applicable

Average in a matrix with hours and week days, results are too low

I'm trying to create a heatmap, with weekdays (TableB) in the columns, and hours (TableC) in the rows and an average value (TableA)

 

Table A where the value is located looks something like this:

 

DateHourItemIDPersonIDItemID_2UnitsSold
2024-04-0313AC1Bob123100
2024-04-0313AC2Bob12350
2024-04-0313AC1Sam321100
2024-04-0314AC1Bob321200

 

There could be tens of rows per hour per PersonID (per day)

ItemID_2 has a relation to a lookup table that we use to filter out the correct number of units sold. 

My issue here is that a simple calcualtion of 

 

var _unitssold = CALCULATE(

    AVERAGE('TableA'[UnitsSold]),

        d_lookup[Metrics | Lookup]   = "Count",

        d_lookup[Exclusion | Lookup] = 0

    )

RETURN

_unitssold

 

This gives me waaaaaaay to low numbers. And I'm not entirely sure why.

I've tried using removefilters for weekday and hour but that's not it either.

Something like this but with averages

 


HourMonTueWedThuFriSatSun
1       
2       
3       
4       
5       
6       
7       
8       
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Solved: 

 

I had previously tried using sum instead of average, and then dividing with the number of days in the selected period. 

I double checked and it seemed that the variable counting days was way off. after I fixed that the numbers now makes sense... 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Solved: 

 

I had previously tried using sum instead of average, and then dividing with the number of days in the selected period. 

I double checked and it seemed that the variable counting days was way off. after I fixed that the numbers now makes sense... 

foodd
Super User
Super User

Hello @Anonymous , and thank you for sharing a question with the Community.   This reply is informational.  Please  remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

 

If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.  Proud to be a Super User!

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.