Forum Discussion

pprasad2's avatar
pprasad2
Helper I
6 years ago
Solved

PREVIOUSDAY function Duplicate Dates Error

Hi, 

I am trying to find out the previous day Service Requests(Based on date user chooses) and it seems like I am mising something.

My data looks like this. I have date in the same table.

 

My New Measure for Prior Day request is like this:

I am getting the following error:

 

I even tried with 'LAST DATE' & NEW COLUMN given in below post but still did not work.

https://community.powerbi.com/t5/Desktop/Previousday-function-problem/m-p/1100277#M509432

New Column = SUMX(FILTER(DLY_VW, DLY_VW[Date Range]=EARLIER(DLY_VW[LastDate])-1), [Total Servcie Change Requests])

Can somebody help me with this?

 

Regards

PPRASAD2

 

 

 

  • Hi , pprasad2 

    I can reproduce your problem. For more details ,please check the sample file.

     

    You are using time intelligence functions PREVIOUSDAY which is suggest to use with a separate date table/dimension.

    There are duplicate values(Date Range) in your table ( same date in multiple rows ).

    It is suggest to create a calendar table with unique and continuous dates that cover all periods of your fact table.

     

    sample file

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

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

    Hi , pprasad2 

    I can reproduce your problem. For more details ,please check the sample file.

     

    You are using time intelligence functions PREVIOUSDAY which is suggest to use with a separate date table/dimension.

    There are duplicate values(Date Range) in your table ( same date in multiple rows ).

    It is suggest to create a calendar table with unique and continuous dates that cover all periods of your fact table.

     

    sample file

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

    Hi , pprasad2 

    Could you please tell me whether your problem has been solved?
    If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.