Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Dynamic Date between start date and End Date

Hi Team, i am connecting Azure SQL DB into power bi and using view to build power bi report. Here my all columns coming from same view.  I have to give this below logic selection to user. How we will implement this logic and provide the the filter in power bi.

(wel.event_start_datetime <= <user input end time> and wel.event_end_datetime >= <user input end time>))
 

6 Replies

  • Anonymous have you created a date dimension table in your file ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      No we dont have any dimension table

  • Anonymous , Create an independent date table and try a measure like

     

    Measure = var 
    _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date]) 
    return CALCULATE(COUNTROWS(Table), filter(Table, Table[Event_satrt_date] <=_max && Feuil1[Event_end_date] >=_max))
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit, We dont have any date table in my model becacuse all are coming from same view only

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Anonymous , Create a one using the calendar

        To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Are your start date and end date in two different columns?
    Here is a similar post, you can refer to:

    Use a date slicer to filter on a period instead of a single date

     

    If not, just put the date column into the slicer then select between option.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.