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
Paulompm
Frequent Visitor

Splitting monthly goals per seller

Hello everyone,

I'm new at powerBI and I have some doubts. I need to split monthly sales goals per sellers. This data will be displayed in an matrix.

 I work with four simple tables: Sales fact, calendar,sales goals of the branches and branch description. e.g.:

 

Sales fact:

DateBranchSellerValue
01/27/20161Marcos909,90
01/27/20161Pedro1.000,00
01/27/20161Zacarias8.000,00
01/27/20163Diego910,00
01/27/20163Luke850,00
01/27/20163John498,00
01/27/20164Matias1.469,00
01/27/20164Pietra1.000,00
01/27/20164Samira6.000,00
02/15/20161Fabio2.199,00
02/15/20161Pedro2.000,00
02/15/20161Zacarias541,00
02/15/20163Mat2.500,00
02/15/20163Luke600,00
02/15/20163John210,00
02/15/20164Marcos1.767,00
02/15/20164Pietra100,00
02/15/20164Samira1.000,00
03/10/20161Tadeo1.599,00
03/10/20161Pedro540,00
03/10/20161Emanuel659,00
03/10/20163Diego1.009,90
03/10/20163Luke500,00
03/10/20163Elizabeth800,00
03/10/20164Matias1.310,00
03/10/20164Pietra548,00
03/10/20164Rafaela222,00

                                                                                                   

Montly Branchs Sales Goal(I only analyze by month and year): 

DateBranchSales Goal
01/01/2016110.000,00
01/01/2016312.000,00
01/01/2016410.000,00
02/01/2016111.000,00
02/01/2016312.000,00
02/01/2016414.000,00
03/01/201618.000,00
03/01/201635.000,00
03/01/201649.000,00


Calendar(Has all the dates day by day from 2014 until 2017):                                                                                                          

DateYearMonthMonth Name
01/01/201220121January
01/01/201320131January
01/01/201420141January
01/01/201520151January
01/01/201620161January
01/01/201720171January


                                                              

Branch Description:

BranchBrandRegionStateCity
1AtacadoR1RJRio de Janeiro
3VarejoR1RJNiteroi
4AtacadoR3SPBauru


Relationships:

 

Branch Description           Sales Fact

 

Branch                       1:*       Branch

 

Branch Description           Montly Branchs Sales Goal

 Branch                       1:*       Branch

 

Calendar      Montly Branchs Sales Goal

 Date       1:*       Date

 

Calendar      Sales fact

 Date       1:*       Date

 

 Measures:

  

Total sales = SUM('Sales fact'[Value]) 
Total Sellers = DISTINCTCOUNT('Sales fact'[Seller])
Total goals = SUM('Branchs sales goals'[Goal])
Goal per seller = [total goals]/[sellers]
% Goal reached = [Total sales]/[goal per seller]

 The matrix doesn't work or reports wrong values. Even when I apply the year and month filter, old sellers(from other years and who no longer work in the company) appear in the matrix.

 

Expected Result

The goal is to have an matrix that informs the following information(There are 3 filters in the report. Branch filter, year and month):

SellerTotal SellersSales GoalTotal Sales%Goal Reached
Seller X14000300075,0%
Seller Y14000380095,0%
Seller Z140004000100,0%
Total3120001080090,0%

 

I hope I have been clear in my doubts. Thank you for your attention. 

 

 

 

 

 

 

 

 

 

 

 

 

                                       

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

First, great post, all the information needed to recreate the problem.

 

I have created this model and feel that it is working. A couple of things. First, make sure that your relationship between your Sales Fact table and your Branches table is cross-filtering in both directions. Second, make sure that you are using "Branch" column from your Branches table, etc. I can post a screen shot of my model or share it with you if you would like.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

First, great post, all the information needed to recreate the problem.

 

I have created this model and feel that it is working. A couple of things. First, make sure that your relationship between your Sales Fact table and your Branches table is cross-filtering in both directions. Second, make sure that you are using "Branch" column from your Branches table, etc. I can post a screen shot of my model or share it with you if you would like.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

First, I'm pretty sure I followed your guide on how to make a good post. Thanks for the guide.

 

I was able to solve most of the problems with your suggestion to cross-filtering in both directions. After that I researched new formulas and managed to format the matrix the way I wanted.

 

Thanks for the help and attention. Problem solve.

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.