Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

DAX NB

Hello,
I have a problem:
on power bi I have a table that contains several columns and among these columns, I have a measure that determines the number of vehicles planned/synchronized.
Here is the formula for measuring the number of planned/synchronized vehicles:

 

Nbr_VHS_ScheduledSynchronized = CALCULATE(SUM('db_infocentre PX_installCR'[nb_box]), OR('db_infocentre PX_intervention'[status]="IN_PROGRESS" , 'db_infocentre PX_intervention'[status]="SCHEDULED"))


My goal is to determine from today's date the number of vehicles planned/synchronized in the current month, in month m+1, in month m+2, m+3, m+4 and m+x. I want to determine them from the current date and add them in my table as a column. So if in 2 months I consult my table, I want it to show me these numbers according to the date in which we are.

 

5 Replies

  • Anonymous , based on what I got so far, new measures like

     

    Nbr_VHS_ScheduledSynchronized remining for this month = CALCULATE(SUM('db_infocentre PX_installCR'[nb_box]), filter('db_infocentre PX_intervention', OR('db_infocentre PX_intervention'[status]="IN_PROGRESS" , 'db_infocentre PX_intervention'[status]="SCHEDULED") && 'db_infocentre PX_intervention'[Date] >= Today() && 'db_infocentre PX_intervention'[date] <= eomonth(Today(), 0)))

     

    Nbr_VHS_ScheduledSynchronized remining till next month = CALCULATE(SUM('db_infocentre PX_installCR'[nb_box]), filter('db_infocentre PX_intervention', OR('db_infocentre PX_intervention'[status]="IN_PROGRESS" , 'db_infocentre PX_intervention'[status]="SCHEDULED") && 'db_infocentre PX_intervention'[Date] >= Today() && 'db_infocentre PX_intervention'[date] <= eomonth(Today(), 1)))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Okay thank you. What means  : eomonth(Today(), 1)))

      • Anonymous's avatar
        Anonymous
        Not applicable

        EOMONTH returns the date in datetime format of the last day of the month before or after a specified number of months.
        So eomonth(Today(), 1) returns the last date of the next month with respect to the current month.

    • Anonymous's avatar
      Anonymous
      Not applicable

      for month +2 is it : 

       

      Nbr_VHS_ScheduledSynchronized remining till next month = CALCULATE(SUM('db_infocentre PX_installCR'[nb_box]), filter('db_infocentre PX_intervention', OR('db_infocentre PX_intervention'[status]="IN_PROGRESS" , 'db_infocentre PX_intervention'[status]="SCHEDULED") && 'db_infocentre PX_intervention'[Date] >= Today() && 'db_infocentre PX_intervention'[date] <= eomonth(Today(), 2)))