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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
troy8
New Member

New Measure question and data structure

I have a set of sales data that shows the sales by month for each region for each product.

 

I want to calculate the number of each product sold for each region per day I was open.  If I write it a calculate formula to do so, it seems I would have to write a seperate calculate formula for each month and product (i.e. 12 different new measures).  Am I thinking about this wrong?  Or is there a way to do it where it knows to do it for each month (i.e. one formula).  Or is there no way to it this way based on the structue of the data?  Do I need to restructure it (i.e. unpivot the months to a column).

 

Appreciate any feedbackon this as new to Power BI.

 

Thanks.

 

 

Data example.JPG

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@troy8

 

What does your source table look like?

 

I assume you should have a fact table which contains the sales per product per month per region. Then you suppose to have another table which includes the opendays associated to each month.

 

You just nees to build the relationship between two tables on Month columns.

 

6.PNG

 

9.PNG

 

Then you can easily have sales divided by OpenDays.

 

sales per day = 'Table 2'[Sales]/RELATED('Month'[OpenDays])

7.PNG

 

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Employee
Employee

@troy8

 

What does your source table look like?

 

I assume you should have a fact table which contains the sales per product per month per region. Then you suppose to have another table which includes the opendays associated to each month.

 

You just nees to build the relationship between two tables on Month columns.

 

6.PNG

 

9.PNG

 

Then you can easily have sales divided by OpenDays.

 

sales per day = 'Table 2'[Sales]/RELATED('Month'[OpenDays])

7.PNG

 

 

Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors