Forum Discussion
Average
Hi, Laska02
To average your customer count data by weekday in Power BI, you'll want to create a calculated column for the day of the week, and then use the AVERAGE function within the context of a visualization, not a new table.
Here are the steps you should follow:
Add a Calculated Column for Day of the Week:
Click on the modeling tab in the Power BI Desktop and then on the "New Column" button.
You'll want to use the WEEKDAY function to create a new column that represents the day of the week. The formula will look something like this:
DayOfWeek = WEEKDAY('YourTable'[Date])
This will return a number from 1 (for Sunday) to 7 (for Saturday), according to the default parameter. If you want to start with Monday as 1, modify the function as follows:
DayOfWeek = WEEKDAY('YourTable'[Date], 2)
You might also want to use the FORMAT function to return the actual name of the weekday:
DayOfWeekName = FORMAT('YourTable'[Date],"dddd")
Use the AVERAGE Function in a Visualization:
Once you have the Day of Week column, you can then create a visualization (like a bar chart) that shows the average values for each day of the week.
Drag your "DayOfWeekName" column to the Axis area and your "values" column to the Values area. By default, Power BI may sum your values. You will need to click the dropdown arrow next to the field name in the Values area and select "Average" instead of "Sum".
You should now see a chart that gives the average customer count for each day of the week.
Thank you for your response, I've been on vacation, hence the late response.
Unfortunately this is not the solution.
I have already applied the method you recommend and also incorporated it into the example, this is table 2.
For Monday, PowerBi then divides the number of customers by the product of the number of Mondays and the number of measurement moments).
Do you have another idea?