SOLVED

Mailing list from Power Pivot

Iron Contributor

I have 3 tables:

  • a dimension table with suppliers,
  • a dimension table with SKU's,
  • a fact table of purchase orders.

(See simplified data below and in attached workbook).

tSuppliers:

bartvana_0-1632544324216.png

tSKUs:
bartvana_1-1632544336681.png

tPOs:

bartvana_2-1632544350252.png

I have added these to a Power Pivot model.

bartvana_3-1632544430760.png

I now want to have a mailing list of the suppliers that:

  • have a purchase order between 2015 and 2020
  • concerning only SKU's that have stockvalue = 1

The mailing list needs to have the same columns as my Suppliers table (it's actually a filtered list of the Suppliers table).

I can do this in Power Query or with XLOOKUP's and formula's, but my question is: is it possible to generate such a list using Power Pivot only?

I got this far:

bartvana_5-1632544846026.png

 

but I have two problems:

  1. The mailing info is missing of course (Country, Street, City)
  2. The Stockvalue filter isn't working. Stockvalue is filtered = 1, but eg. SKU01 has Stockvalue = 0 and still it is listed.

So my questions are:

  1. Why is the stockvalue filter not working?
  2. If such a mailing list can be generated with a Power Pivot Pivot table, how?
  3. If this is impossible in Power Pivot, what would your most efficient general approach be to creating such a mailing list?

(My real data and filter requirements are obviously a bit more complex, so I'm interested rather in methods and strategies, than a quick solution for the simplified sample data).

Many thanks in advance!

7 Replies

@bartvana Perhaps the attached file helps.

 

@Riny_van_Eekelen So actually the Stockvalue filter was already working, right? I misinterpreted the data, I see now.

If I'm correct, you tweaked the PivotTable with the Design options? Or did you do something else too?

bartvana_0-1632584022869.png

 

@bartvana Didn't tweak much more than choosing a tabular layout. Other than that, I also changed the selection of fields (Row, Column and Value) as you can see in the pivot table fields window.

best response confirmed by bartvana (Iron Contributor)
Solution

@bartvana 

As a comment, that's a best practice to hide fields on "many" side of relationship and don't use them in reports.

image.png

Slightly modified @Riny_van_Eekelen  solution, you may use measures

Total SKUs:=CALCULATE( COUNTROWS( tPOs ), CROSSFILTER( tSKUs[SKU], tPOs[SKU], Both ) )

SKUs:=CALCULATE( CONCATENATEX(tSKUs, tSKUs[SKU], ", "), CROSSFILTER( tSKUs[SKU], tPOs[SKU], Both ) )

to have PivotTable in bit different form

image.png

@Sergei Baklan Thank you for the tips.

Thank you both for your help!

I'm just not sure which answer to mark as best response now :)

@bartvana A like will do. Haha!

@bartvana 

Actually Best responses and likes are only help to promote this resource (TechCommunity) on the web. More of them more visible the resource. Just SEO stuff.

 

From personal point of view that doesn't matter, at least for me. Anyway, thank you for the feedback.

1 best response

Accepted Solutions
best response confirmed by bartvana (Iron Contributor)
Solution

@bartvana 

As a comment, that's a best practice to hide fields on "many" side of relationship and don't use them in reports.

image.png

Slightly modified @Riny_van_Eekelen  solution, you may use measures

Total SKUs:=CALCULATE( COUNTROWS( tPOs ), CROSSFILTER( tSKUs[SKU], tPOs[SKU], Both ) )

SKUs:=CALCULATE( CONCATENATEX(tSKUs, tSKUs[SKU], ", "), CROSSFILTER( tSKUs[SKU], tPOs[SKU], Both ) )

to have PivotTable in bit different form

image.png

View solution in original post