Forum Discussion
Sales provision report
Hi, I want to filter a table with provision by custommer and goods groups.
I want to be able to filter by customer and if the sales person visited the customer then filter the corresponding provision by goods group.
I tried several ways of filtering and calculating but none really worked. Can someone help and direct me in the right direction?
Thanks al lot!
Alex
Here is a sample of the structure.
Table 1 = Reporting of Sales person
| Customer | Goods Group 400 | Goods Group 420 | Goods Group 470 | ||
| 100204 | 400 | 470 | |||
| 103008 | 400 | 420 | |||
| 109714 | 420 | 470 |
Table 2 = Customer
| Customer |
| 100204 |
| 101212 |
| 105203 |
| 103008 |
| 106902 |
| 109714 |
Table 3 = Provision
| Customer | ItemID | Provision | Goods Group |
| 100204 | 102001 | 69,30€ | 400 |
| 100204 | 102102 | 23,80€ | 420 |
| 100204 | 102345 | 60,90€ | 470 |
| 109714 | 102456 | 70,00€ | 400 |
| 109714 | 102543 | 65,00€ | 420 |
| 109714 | 102534 | 67,00€ | 420 |
| 109714 | 102575 | 99,00€ | 470 |
4 Replies
- Greg_DecklerCommunity Champion
MedtechServices - I would start by unpivoting your Goods group columns in Table 1.
- DataInsightsSuper User
MedtechServices, try this:
1. Unpivot the table Reporting of Sales person (table 1). The data should look like this:
2. Create calculated columns:
Reporting of Sales person table (table 1): Key = SalesReporting[Customer] & "-" & SalesReporting[Goods Group] Provision table (table 3): Key = Provision[Customer] & "-" & Provision[Goods Group] Sales Person Visited = VAR vKey = Provision[Key] VAR vSalesTable = FILTER ( SalesReporting, SalesReporting[Key] = vKey ) VAR vRowCnt = COUNTROWS ( vSalesTable ) RETURN IF ( vRowCnt > 0, "Y", "N" )3. Join tables:
4. Create slicer using Provision[Customer].
5. Create table visual.
6. Set table visual filter:
7. Result:
- amitchandakSuper User
MedtechServices , Unpivot the table and merge them with customer id join and try
https://radacad.com/pivot-and-unpivot-with-power-bi
Unpivot - https://www.youtube.com/watch?v=2HjkBtxSM0g
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/Append - https://radacad.com/append-vs-merge-in-power-bi-and-power-query
- AnonymousNot applicable
Hi MedtechServices,
Did these suggestions help with your scenario? IF this is a case, you can consider accepting the most suitable one as solution to help others who have similar requirements.
If not, please share more detailed information to help us clarify your requirement.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng