Forum Discussion
Power Pivot Filters
- 6 years ago
Yes, small tweaks, but instead of one measure it is now 4, so rather than post them all here, just grab the PBIX file. It returns a table like this:
I appreciate the candle offer, but I'm just here to help. 🙂
Sorry, to be clear.
I need the data to be available in Power Pivot, so I can create reports from the data.
Cheers
Sam
Again, if you could post some sample data that is representative or your actual data (same columns, enough rows to work with, etc) it would help us. Just writing a paragraph about your data layout isn't helping me see your model very well. Tables are worth a thousand words. 😁
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
- SamTaylor6 years agoHelper I
Please see below my test data for the GRN table.
I need the ability to include in my pivot table the last receipt date for a Product and the Qty received, in the location UK or US.
I can work it out for Total Qty received by product by location, just escapes me how to get the qty for the last receipt date.
Thanks
Sam
Product Location GRN Qty Supplier Receipt Date LK-049 UK GR 223 20 Howhot 10/07/2020 LK-049 US GR 224 5 Howhot 11/07/2020 LK-047 UK GR 223 20 Howhot 10/07/2020 LK-047 US GR 224 5 Howhot 11/07/2020 LK-048 UK GR 223 20 Howhot 10/07/2020 LK-049 UK GR 225 20 Howhot 14/07/2020 LK-049 UK GR 123 20 Howhot 10/06/2020 LK-049 US GR 124 5 Howhot 11/06/2020 LK-047 UK GR 123 20 Howhot 10/06/2020 LK-047 US GR 124 5 Howhot 11/06/2020 LK-048 UK GR 123 20 Howhot 10/06/2020 LK-049 UK GR 125 20 Howhot 14/06/2020 - SamTaylor6 years agoHelper I
This is an image of the table, seemed to get mixed up when i posted the original
- edhans6 years agoCommunity Champion
Hi SamTaylor , thank you for the sample data. I wrote a measure that returns this, which is the quantity for the last receipt date of a product by location. Given that your quantites for UK and US are always the same, it is hard to see that my measure works though i this screen shot.
Last Qty and Date by Location = VAR varCurrentLocation = MAX( 'Table'[Location] ) VAR varCurrentProduct = MAX( 'Table'[Product] ) VAR varLastDateByLocation = MAXX( FILTER( ALL( 'Table' ), 'Table'[Location] = varCurrentLocation && 'Table'[Product] = varCurrentProduct ), 'Table'[Receipt Date] ) VAR Result = CALCULATE( SUM( 'Table'[Qty] ), FILTER( ALL( 'Table' ), 'Table'[Location] = VarCurrentLocation && 'Table'[Product] = varCurrentProduct && 'Table'[Receipt Date] = varLastDateByLocation ) ) RETURN Result