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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.