Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
gap
Helper I
Helper I

Ignore Lowest Part of a Date Range

Hi

 

I have a table with Warehouse transactions. Each transaction is one record, having for example the location number and the changed quantity (also linked to an items table). The "tricky" this is that since it records transactions, i do not have the actual quantity but the "change" (either addition or removal).

 

The report will have on data slicer. What i am trying to achieve is to ignore the lowest part of the slicer, therefore to be able to obtain status on the maximum selected (by the slicer) date.

 

I created a measure "Warehouse Total Remaining Quantity" which works ok. Now i am trying to calculate the Distinct Items remaining on the warehouse (not stock quantity). Therefore i need to have the DIstinct Items having quantities on the Max selected date (therefore "Warehouse Total Remaining Quantity">0)

 

Below you can see the measures along with a table. Basically the table should be able to show  "Warehouse Distinct Items" = 1, where the Quantity>0

 

Warehouse Total Remaining Quantity =
var LastDay=MAX('Date'[Date])
RETURN
CALCULATE(SUM('Warehouse History'[Quantity Changes]); FILTER( ALL('Date');'Date'[Date]<=LastDay))
 
Warehouse Distinct Items =
var tabl = SUMMARIZE( 'Warehouse History'; Vessel[Vessel Name]; Items[Item No];
"Remaining";CALCULATE([Warehouse Total Remaining Quantity]) )
RETURN
CALCULATE( DISTINCTCOUNT(Items[Item No]); FILTER( tabl; [Remaining]>0 ) )
Capture.JPG
 

Thanks

George

1 ACCEPTED SOLUTION

Hi,

This measure works

Measure2 = COUNTROWS(FILTER(CALCULATETABLE(VALUES(Items[PartNo]),DATESBETWEEN('Date'[Date],MAX('Date'[Date]),MAX('Date'[Date]))),[Warehouse Total Remaining Quantity]>0))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

12 REPLIES 12

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.