Use harvested dates in virtual table

I created a virtual table by using ADDCOLUMNS. I need to know how to filter for the harvested dates from the date slicer. I’ve tried declaring the start date and end date variables to use DATESINBETWEEN but am not able to. The harvested date fields are in my Dates table.

Billings PLT Virtual = 
ADDCOLUMNS(
    VALUES( billing_activities[Bill Date] ),
   "Billing Qty PLT", billing_activities[Total Quantity PLT] ,
   "Running Billing Qty PLT", 'billing_activities'[Running Billings PLT],
   "Billing PLT", [Total Billing PLT] ,
   "Running Billing PLT", 'billing_activities'[Running Billing Qty PLT] )

There is a table included in the DEMO .pbix file that I tried creating called Billings PLT Virtual - Filtered using techniques I found in the forum but it’s not correct yet.

DEMO.pbix (930.3 KB)

@LASHBURN,

The way I would do this is to create the following measure:

Within Range = 
IF( 
    SELECTEDVALUE( 'Billings PLT Virtual'[Bill Date] ) >= [Harvest Min Date]  &&
    SELECTEDVALUE( 'Billings PLT Virtual'[Bill Date] ) <= [Harvest Max Date],
    1,
    0
) 

And then drop that in the filter pane:

I hope that’s helpful.

– Brian

P.S. Billings PLT Virtual is a calculated table/DAX expression table, not a virtual table. It sounds like a semantic quibble, but it’s actually quite an important distinction. I recently did a video on this issue that you may find helpful:

1 Like

Awesome! Works great!!
I will be sure to watch the video, thanks for the clarification Thanks Brian

1 Like