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
Anonymous
Not applicable

SELECTEDVALUE based off of slicer value

Hello!

 

So I have four tables in my report. 

Sales Rep, Work Order Items, Commission Split, and Commission Split Detail. 

I'm trying to build a column in the work order items table called "%age of sale based off of the commission split table". 

I have set up the relationship so a Work order Item can share 2 or more sales reps based on the commission split / detail table.

If there is a split, the percentage has to be equal to 100%. 

However I need it to be able to filter the work order items table off of a single rep that I choose from a slicer since based on the Sales Rep taable since one item can be linked to more then one sales rep.  I also need to be able to build an accurate sales report per rep.

 

Lets say I choose Adam in the slicer, below is an example of what I want to happen:

 

Sales Rep Table      
Sales Rep (Unique)     
Adam      
Gunther      
Devon      
       
Commission Split Table     
Record ID (Unique)Work Order #     
510     
811     
1012     
       
Commission Split Detail Table     
Record ID (unique)Commission Split Record IDWork Order #Sales RepSplit in Percentage  
1000510Adam75%  
1001510Gunther25%  
1002811Adam50%  
1003811Gunther25%  
1004811Devon25%  
10051012Gunther40%  
10061012Devon60%  
       
Work Order Items Table     
ItemWork Order # (Unique)Commission Split Record IDCostSellCommission Split # (Unique)Column to populate based off of the sales rep I choose from the slicer. Will populate with the split in percentage
Window A10520005000575%
Window B10515002000575%
Window A11878150850%
Window C1210500100010N/A because he is not on that commission split / detail so does not get credit.

 

Once I get the %age of sale in this column I will be able to multiply the cost and sell by this #age to get his credit for the sale.

 

I hope this makes sense.  I'm happy to further clarify if there is any confusion.  Thanks for the help!

1 ACCEPTED SOLUTION
v-joesh-msft
Solution Sage
Solution Sage

Hi @Anonymous ,
First, you should know that the calculated column and calculate table can't be affected by any slicer. you could create a measure instead of a column.
Notice:
1. The calculated column/table does not support dynamic changed based on filter or slicer.
2. A measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
here is reference:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

For your case, as long as the relationship between the tables is correctly created, you can directly use a table or matrix to achieve your corresponding results.

51.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ebt2WOSYB_FAhCkfIS2Gp8UBha5LAdVmKlMr_rw3dW-k1Q?e=Kj909D

Best Regards,

Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
v-joesh-msft
Solution Sage
Solution Sage

Hi @Anonymous ,
First, you should know that the calculated column and calculate table can't be affected by any slicer. you could create a measure instead of a column.
Notice:
1. The calculated column/table does not support dynamic changed based on filter or slicer.
2. A measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
here is reference:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

For your case, as long as the relationship between the tables is correctly created, you can directly use a table or matrix to achieve your corresponding results.

51.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ebt2WOSYB_FAhCkfIS2Gp8UBha5LAdVmKlMr_rw3dW-k1Q?e=Kj909D

Best Regards,

Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

This worked great! however I'm having a new problem now.  I made a measure to multiply the sell * %age and that column worked in the table / matrix.  However at the total of the bottom of the column its giving me a 10x bigger number then it should.  Would you know why?

Hi @Anonymous ,

This looks like a measure totals problem. Very common. See this post about it: 
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Best Regards,

Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

thanks for all the help.  I'm now running into an issue where my report is only showing items that have a Commission Split Record ID.  Not every work order item will have a split if the sales rep is solely doing the work. the example above was not 100% accurate.  Please see new example below:

 

 Sales Rep Table      
 Sales Rep (Unique)     
 Adam      
 Gunther      
 Devon      
        
 Commission Split Table     
 Record ID (Unique)Work Order #     
 510     
 811     
 1012     
        
 Commission Split Detail Table     
 Record ID (unique)Commission Split Record IDWork Order #Sales RepSplit in Percentage  
 1000510Adam75%  
 1001510Gunther25%  
 1002811Adam50%  
 1003811Gunther25%  
 1004811Devon25%  
 10051012Gunther40%  
 10061012Devon60%  
        
 Work Order Items Table     
 ItemWork Order # (Unique)Commission Split Record IDCostSellCommission Split # (Unique)Column to populate based off of the sales rep I choose from the slicer. Will populate with the split in percentage
 Window A10520005000575%
 Window B10515002000575%
 Window A11878150850%
 Window C1210500100010N/A because he is not on that commission split / detail so does not get credit.
 Window A18NONE50100 100%

 

The only Work around I can think of is to duplicate all queries and have one that has a commission split record ID and one that does not.

 

Does this make sense? Thanks

 

Hi @Anonymous ,

Based on the created model, you need to concatenate the table "Commission Split Detail" and the table "Work Order Items" with the intermediate table "Commission Split" and use "Work Order #" as the unique field. Enter the corresponding record in each table. The results are as follows:

11.PNG12.PNG13.PNG14.PNG15.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUW-LqBfKFJGh1pKl0EfFoQBA1VV-nDnY0FzWFnr59CI9Q?e=rdB5e6

Best Regards,

Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

So thanks for the continued answers but I did not give you the proper data.  here is the proper data.

 

Sales Rep Table         
Sales Rep (Unique)        
Adam         
Gunther         
Devon         
          
Commission Split Table        
Record ID (Unique)Work Order #        
510        
811        
1012        
          
Commission Split Detail Table        
Record ID (unique)Commission Split Record IDWork Order #Sales Rep to splitSplit in Percentage     
1000510Adam75%     
1001510Gunther25%     
1002811Adam50%     
1003811Gunther25%     
1004811Devon25%     
10051012Gunther40%     
10061012Devon60%     
          
Work Order Table         
Record IDWork Order Main Sales Rep        
10Gunther        
11Adam        
12Gunther        
18Adam        
          
          
          
Work Order Items Table        
ItemWork Order # (Unique)Wrok Order Main Sales Rep (Linked)Sales Rep to splitCommission Split Record IDCostSellCommission Split # (Unique)Column to populate based off of the sales rep I choose from the slicer. Will populate with the split in percentage 
Window A10GuntherAdam520005000575%should show up because he is on the commission split.
Window B10GuntherAdam515002000575%should show up because he is on the commission split.
Window A11AdamAdam878150850%should show up since he is main sales rep and on the commission split
Window C12GuntherNONENONE5001000NONENONESHOULD NOT SHOW UP BECAUSE HE IS NOT THE MAIN SALES REP OR SALES REP TO SPLIT
Window A18AdamNONENONE50100NONE100%should show up because he is the main sales rep of the work order / all items.

 

For every work order, there is a MAIN SALES REP.  This person is responsible for doing most of the work.  There can also be a commission split i.e. a Work Order can be split between 2 or more sales reps as long as the percentage is equal to 100%/

 

So the two scenarios are 

a Work order with no commission split.  So just the MAIN SALES REP gets credit for the work order.

a Work order with a commission split.  All Sales rep(s) in the commission split will get their %age credit for the work order.

 

If I choose Adam from the data above I want it so show as this:

Work Order Items Table       
ItemWork Order # (Unique)Wrok Order Main Sales Rep (Linked)Sales Rep to splitCommission Split Record IDCostSellCommission Split # (Unique)Column to populate based off of the sales rep I choose from the slicer. Will populate with the split in percentage
Window A10GuntherAdam520005000575%
Window B10GuntherAdam515002000575%
Window A11AdamAdam878150850%
Window A18AdamNONENONE50100NONE100%

 

on work order 10, gunther is the MAIN SALES REP, but adam is on the comission split for the work order.  So when I choose adam from the sales rep slicer i want the commission percentage to show as 75%% for these items. on work order 11 he is the MAIN SALES REP and on a commission split, so he would get his %age of the work order from the commission split i.e 50%.  On Work Order 18, he is the MAIN SALES REP and there is no commission split for this work order.  So when I choose him, all work order items for work order 18 need to show up as 100%.

 

Is this possible with how the data is setup?

 

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.