Hi All ,
The above table shows Client 1 requested a backorder for Apples on 3 x Different dates.
I want to showcase the count as 1 using use relationship on the created date but only for the first date (i.e-17/4/2020)
My Measures:
Total Count = DISTINCTCOUNT('Data'[Name])
Earliest Count = VAR Products_Ordered =
SUMMARIZE( 'Data', 'Data'[Status], 'Data'[Name],'Data'[Created Date] )
VAR First_Entry_Products_Ordered =
ADDCOLUMNS(
Products_Ordered,
"Earliest Created Date", MIN( 'Data'[Created Date] )
)
VAR First_Entry_Products_Ordered_By_Min_Date =
TREATAS(
First_Entry_Products_Ordered,
'Data'[Status],
'Data'[Name],
'Data'[Created Date],
'Dates'[Date]
)
VAR Result =
CALCULATE( [Total Count], First_Entry_Products_Ordered_By_Min_Date )
RETURN
Result
Total by Status = VAR Filt =
FILTER( 'Data', 'Data'[Status] IN { "Shipped", "Backorder" } )
RETURN
CALCULATE(
[Earliest Count],
Filt,
USERELATIONSHIP ( 'Dates'[Date], 'Data'[Created Date] )
)
Output:
Expected Output:
Should only show the value for FY20 as the first date is 17/4/2020
I think it has something to do with the date context of my measure but can’t seem to figure out where to resolve it.
I found this post : Calculate the sales amount from earliest date for same customerID with multiple orderdate useful, however still unsure how i can get the min date from the measure to use in userelationship.
Thanks
Sample.pbix (68.9 KB)