Forum Discussion

deepvibha's avatar
deepvibha
Advocate II
9 years ago
Solved

Value summation by date

Hello,

 

I have a table as follows:

 

DateDepartmentReceivedWithin 24 hrsWithin 48 hrs
07-11-16Cornea723
07-11-16Glaucoma1032
07-11-16Retina843
07-11-16Cataract812
14-11-16Cornea1051
14-11-16Glaucoma1033
14-11-16Retina741
14-11-16Cataract822

 

The need is to have % of requests resolved within 24 hrs and 48 hrs, by department and date. For example:

For date 07-11-16 and Cornea department, 29% requests are resolved within 24hrs (2 divided by 7) and 43% requests are resolved within 48hrs (3 divided by 7).

 

I have imported the table in PBI and have unpivoted the columns, which looks as follows:

 

I am also trying to create a column "Cornea24hrs" as seen in the figure, which is not successful.

 

Your help by way of detailed steps would be much appreciated.

 

Thanks a ton.

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi deepvibha

     

    Just change the measures as follows and rest remaining the same as my previous reply

     

    Create Measures - SumReceived, Sum24Hrs, Sum48Hrs as follows

        SumReceived = Calculate(sum (FactTable[Received]),FactTable[Attribute] = "Received")

        Sum24Hrs = Calculate(sum (FactTable[Received]),FactTable[Attribute] = "Within 24 Hrs")

        Sum48Hrs = Calculate(sum (FactTable[Received]),FactTable[Attribute] = "Within 48 Hrs")

     

    This should work.

     

    If this works please accept it as a solution and also give KUDOS.

     

    Cheers

     

    CheenuSing

     

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi deepvibha

     

    You will not be ablt to expactly replicate the excel output in Power BI.

     

    There are two approaches possible.

     

    1. Create a column called DateByDepartment =  Format([TransDate],"DD/MM/YYYY") & "-" & [Department]

    2. Use this as a x-axis and then the measures 24hrs% and 48hrs% as Y-axis.

     

    The out put will look like

     

                                     

     

                         

     

    The x-axis will look like

                             

    Very close to Excel

     

    The second approach is to create a hierarchy

    1. Right click on the Date column of your table and select NewHierarchy

    2. Drag the Department also under this.

    3. Rename this hierarchy as TransDateDepartment

    4. Use this as x-axis and the measures as y-axis.

    5. The chart will initially look like

        

    6. Click on the weighing scale like icon you will see the output as

     

     

     When you click on the two down arrows icon you will get it at Department level.

     

     

    If this works give additonal KUDOS.

     

    Cheers

     

    CheenuSing

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi deepvibha

     

    Please try the following steps :

     

    1. Create Measures - SumReceived, Sum24Hrs, Sum48Hrs as follows

        SumReceived = Sum(FactTable[Received])

        Sum24Hrs = sum (FactTable[Within 24 hrs])

        Sum48Hrs = sum (FactTable[Within 48 hrs])

     

    2. Now create the measure %24Hrs, %48Hrs

       %24hrs = divide ([Sum24Hrs],[SumReceived])

       %48hrs = divide ([Sum48Hrs],[SumReceived])

     

    3. Make these two % measures as data type perccentage.

     

    4. You should get what you wanted, see the screen shot.

     

     

    If this works for you please accept it as a solution and also give KUDOS.

     

    Cheers

     

    CheenuSing

     

    • deepvibha's avatar
      deepvibha
      Advocate II

      Thanks Anonymous

       

       

      The solution given is for pivoted table.

       

       

      I am looking for a solution for an unpivoted table.

       

      Regards,

      Deepak

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi deepvibha

         

        Can you explain what you mean by unpivoted table and the output you desire.

         

        Cheers

         

        CheenuSing