The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I work for a distribution company where we import products from a number of different brands. We often have a number shipments coming in each week and I would like to count and identify what new products that are coming in a selceted shipment and or future timeframe
I have tried the formula below which is a modification of a formula from @EnterpriseDNA but I don't have it quite right. Thanks in advance
New Products =
VAR ProductsNew = VALUES(Products[SKU.1])
VAR CurrentProducts = CALCULATETABLE(VALUES(Products[SKU.1]),
filter(ALL(Dates),
Dates[Date] > MIN(Dates[Date]) &&
Dates[Date] < MAX(Dates[Date])))
return
COUNTROWS(
EXCEPT(ProductsNew,CurrentProducts))
Typically for the count of new things, you compare the current context to the the past context with an approach like this:
New Products =
VAR mindate =
MIN ( Dates[Date] )
VAR CurrentProducts =
VALUES ( Products[SKU.1] )
VAR PastProducts =
CALCULATETABLE (
VALUES ( Products[SKU.1] ),
FILTER ( ALL ( Dates ), Dates[Date] < mindate )
)
RETURN
COUNTROWS ( EXCEPT ( CurrentProducts, PastProducts ) )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.