Forum Discussion

mathew_528417's avatar
mathew_528417
Frequent Visitor
5 years ago

Cumulative working days by month

Hi everyone,

I need help for a problem envolving cumulative working days by month.

For example, I have a job that started at 24/01/2020 and a finish date at 06/03/2020. I expected that chart show me this:

 

 

That is my table and its link with calendar table, that contains a column that flag (second image) a date if it is a working day:

 

Thats is the DAX that i made and its return only the final number. Using the example above, its return 30.


 

Thank you all, guys!

 
 

 

5 Replies

  • Your DAX formula does not filter by the month. if you add that filter then you will get the desired result.

  • mathew_528417 , usually we use the date element like a given example for cumulattive

    Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[date])))

    • mathew_528417's avatar
      mathew_528417
      Frequent Visitor

      Hi amitchandak ,
      first of all, thanks for your helping.

      I did what you suggested and this is the message I got:

       


      Translate: A function 'FILTER' was used in a True/False expression used as a table filter expression. That is not allowed.

  • put your MAX(ft_tabelao[..]) into a variable and then do the less than/equal comparison against that variable.

     

     

  • mathew_528417's avatar
    mathew_528417
    Frequent Visitor

    getting better, guys.
    using MAX(ft_tabelao) as variable, I got this:
    EXAMPLE:

    image.png
    now i need to PBI show me the month between the initial and final dates.
    ps.: if i could send you the pbix, i'm sure that would be easier to solve, but i cant. sorry