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
erezbenmoshe
Advocate I
Advocate I

Aggregate daily sales and compare to monthly targets

I have daily sales data in a SALES TABLE with two columns: ORDER PURCHASE_DATE and ORDER TOTAL.  I also have targets table that has two columns: MONTH and TARGET SALES.

 

I have to build a measure that aggregates sales by month and compare them to the monthly target.

 

The output should be:  % of TARGET = DIVIDE(MONTHLY SALES, MONTHLY TARGERT).

 

Thanks,

Erez

 

 

 

1 ACCEPTED SOLUTION

But drop a calculated column in the sales table:

Month = MONTH('Sales table'[Order purchase date])

This should allow you to create a one to many relationship from the target table to the sales table (Month to month*)

Then create a measure like this: 

TotalOrderSum = Sum('Sales table'[Total Order])

Finally create a table visual and put in:
*Month from taget table
*TotalOrderSum measure
*Target volume from target table


Connect on LinkedIn

View solution in original post

3 REPLIES 3
tex628
Community Champion
Community Champion

Start by creating a connection between the tables. 

I would proberbly use:

Month = MONTH('sales table" [ORDER PURCHASE_DATE])

Then create a relationship to the target sales table.

Finally create a measure,

% of target = ORDER TOTAL / TARGET SALES

Connect on LinkedIn

Thanks for your answer.  I probably was not clear enough in my description.

Target SalesTarget SalesSales TableSales Table

The TARGET SALES table holds target sales on a month level (so 12 rows).

 

The SALES TABLE holds sales by day so I have to aggregate sales to month level  first ('000s of rows).

 

But drop a calculated column in the sales table:

Month = MONTH('Sales table'[Order purchase date])

This should allow you to create a one to many relationship from the target table to the sales table (Month to month*)

Then create a measure like this: 

TotalOrderSum = Sum('Sales table'[Total Order])

Finally create a table visual and put in:
*Month from taget table
*TotalOrderSum measure
*Target volume from target table


Connect on LinkedIn

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.