cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beheshtifarid
New Member

Creating Measure for average yearly & monthly sales for different countries based on working days

Hi everyone,

I want to create a measure which calculates sales based on working days in different countries (three country: DE,AT,CH).

There are two major tables for sales and calender in my data set.

The sales table includes all information about orders in each country and calender table includes all dates and three binary columns for working days in each country.

Sales Table:

datecountrySales
01.01.2022AT20€
01.01.2022AT50€
01.01.2022CH10€
02.01.2022DE20€
.........

 

Caleder Table:

dateworking_day_DEworking_day_ATworking_day_CH
01.01.2022011
02.01.2022100
03..01.2022111
............

  

Now I want to create a measure which calculates avrage of Sales in each country divided by SUM of working days in year/month.

I would appreciate, if someone can help me with this issue.

1 REPLY 1
amitchandak
Super User
Super User

@beheshtifarid , Try a new measure like

 

AverageX(Values(Sales[Country]), calculate(Sum(Sales[Sales]) , filter(calendar, calendar[working_day_DE] =1)))

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors