Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Selecting Prior Date data in a table with Non Contiguous Dates

Hi,

 

I am used to working with Contiguous Dates. We have tables that contain snapshots of a point in time. The table contains the prior day close numbers and the prior month end numbers. 

 

I can get the prior month end just fine without a slicer.

 

I cannot figure out how to incorporate a slicer and pull the prior month end of the selected date.

 

I suspect this is simple and my issue is not knowing what DAX to use. 

 

The data is simple:

 

AR_Snapshot Table DATES_Table
Effective DateAR_Amount CalendarDate
1/29/2019                     10,000 Contiguous Dates 
12/31/2018                       8,000  
11/30/2018                     11,000  
10/31/2018                       7,000  
    
    
Data Expected with Slicer set to 12/31/18 
    
CurrentPrior  
                     8,000.00               11,000.00  
  • hi, Anonymous

    You could try to use PREVIOUSMONTH Function to add a measure like this

    pre amount = CALCULATE(SUM(Table1[AR_Amount]),PREVIOUSMONTH('Date'[Date]))

    Best Regards,

    Lin

     

1 Reply

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, Anonymous

    You could try to use PREVIOUSMONTH Function to add a measure like this

    pre amount = CALCULATE(SUM(Table1[AR_Amount]),PREVIOUSMONTH('Date'[Date]))

    Best Regards,

    Lin