Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measurement by Month

Hi, I'm new with Power BI,

I'm have some measures consist of working and idle time percentage for each month. When I trying to combine the measures in one stacked chart it become like this. 

How can I fix this problem

 

 

  • Hi, Anonymous 

     

    Obviously, the February data above contains data from January. You need to try to make the January measure calculate to 0 when it encounters the February time.

    You can either recreate the measure, or add a judgment condition to the above measure when calculating it,

    for example:

    IF([month]="January",[Percentage Idle Sum (JAN)],0)

     

    Or, please consdier sharing some dummy data and draw a simple picture to show your expected visual , then I can try to look into it to come up with a more accurate measure.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

7 Replies

  • Anonymous , Based on what I got, you need measure that give you % by month. You have measures for each month like Jan /Feb , that will not work.

     

    Please share measure formula

    • Anonymous's avatar
      Anonymous
      Not applicable
      Percentage Idle Sum (JAN) =
      VAR Totwork=
      SUMX(
      JAN,
      HOUR(JAN[Idle]) + MINUTE(JAN[Idle])/60
      )
      VAR ToTalAll=
      SUMX(
      JAN,
      HOUR(JAN[Idle]) + MINUTE(JAN[Idle])/60 + HOUR(JAN[Working ]) + MINUTE(JAN[Working ])/60
      )
      VAR final =(Totwork/ToTalAll)*100
      RETURN
      final

      Percentage Working Sum (JAN) =
      VAR Totwork=
      SUMX(
      JAN,
      HOUR( JAN[Working ]) + MINUTE( JAN[Working ])/60
      )
      VAR ToTalAll=
      SUMX(
      JAN,
      HOUR( JAN[Idle]) + MINUTE( JAN[Idle])/60 + HOUR( JAN[Working ]) + MINUTE( JAN[Working ])/60
      )
      VAR final =(Totwork/ToTalAll)*100
      RETURN
      final






      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , Are these snapshot tables ?

        each month you have data for the last n months. What is the expected output?

  • Hi, Anonymous 

     

    Obviously, the February data above contains data from January. You need to try to make the January measure calculate to 0 when it encounters the February time.

    You can either recreate the measure, or add a judgment condition to the above measure when calculating it,

    for example:

    IF([month]="January",[Percentage Idle Sum (JAN)],0)

     

    Or, please consdier sharing some dummy data and draw a simple picture to show your expected visual , then I can try to look into it to come up with a more accurate measure.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Oh thank you! But I already solved this problem by myself. Thanks again

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

        Hi, Anonymous 

         

        Well, glad to hear the problem is solved
        Could you please consider marking this thread as answered.Thank you.

         

        And it would be better if you could post the solution here which will benefit other users who might have the same issue.

         

         

        Best Regards,
        Community Support Team _ Zeon Zheng

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