Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Measure doesn't work in service

Hello,

i have a measure that works perfectly in desktop but in the service doesn't. I need to count all the workdays in a month. In the service just count the days until today...

Workdays/Month = CALCULATE(SUM('Calendar'[WeekdayWeekend]),DATESBETWEEN('Calendar'[Date], STARTOFMONTH('Calendar'[Date]), ENDOFMONTH('Calendar'[Date])))
 
Thanks for your help,
Regards.

14 Replies

  • Hi there

    Have you refreshed the dataset in the Power BI Service?

    Can you confirm that there is data?

    And finally can you please post an screenshot of the error you are receiving?
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi GilbertQ and v-deddai1-msft,

       

      In the Desktop i have this scenario:

      and in the Service this (after refresh):

       

      Doesn't appear any error, just the counting of the days is wrong.

      I used the SUM measure because i convert all the "Weekday" to 1 and the "Weekend" to 0, i tried to use the COUNT but it doesn't work...

      The Worked days measure is just a SUM of the "Weekdays", the other is a difference between the other two.

       

      Thanks for the help!

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

        Hi Anonymous ,

         

        Would you please show us pbix file by onedrive for business if possible?

         

        Please do mask sensitive data before uploading.

         

        Thanks for your understanding and support.

        Best Regards,

        Dedmon Dai

         

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

    Hi Anonymous ,

     

    Would you please show us the screenshot of the output in desktop and service?And why you use SUM in your formula,  I think you might need to use COUNT .

     

     

    Workdays/Month = CALCULATE(COUNT('Calendar'[WeekdayWeekend]),DATESBETWEEN('Calendar'[Date], STARTOFMONTH('Calendar'[Date]), ENDOFMONTH('Calendar'[Date])))

     

     

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

     

    Best Regards,

    Dedmon Dai

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    I found out that i cannot access to any date next today... I have a calendar table which countains dates until the end of 2020. In the Desktop i can access to them, in the service didn't...

     

    Does someone have the same problem?

     

    Thanks for your help.

     

    Best Regards, Ana.