Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Need Help With Calculations - DAX Maybe?

Hello all.  Hope you're doing well and staying safe.  I am finally at the last stretch of finishing my dashboard.  However, I need help with creating a card that displays a total percentage.  I know it's probably confusing but allow me to explain with the table below:

Operating UnitAnnual Leave HrsC Details (Exluding Partners)NC Details (Including Partners)C Hrs (Excluding Partners)C Hrs (Including Partners)Utilisation % (Excluding Partners)Utilisation % (Including Partners)
A2,3066,2206,79413,57613,98069%67%
B6682,2693,0404,8944,89468%62%
C1,8624,6105,93310,68811,04070%65%
D3,27111,20212,15521,20922,07265%64%
E2641,3951,3959,1089,10887%87%
F1021,4002,13366390832%30%
G5,56218,13121,37536,59338,85067%65%
Grand Total14,03545,22752,82596,731100,85268%66%

 

I have calculated the percentages as well from the grand total.  How am I able to use just the "68%" and the "66%" (last line within the grand total) and display it on my card.  Is there a method in which I could just extract that number and put it into the card?  OR do I calculate from the grand total using DAX and obtain the percentage from there?  I do not know much from DAX so any help would be highly appreciated.  Thanks!

 

Thanks.

  • Hi Anonymous ,

     

    Use the following measure:

     

    Measure = CALCULATE(MAX('Chargeability Detail by OU'[
    Utilisation for Chargeability Detail(Include Partners)]),'Chargeability Detail by OU'[
    Operating Unit] = "Grand Total")

     

    Best Regards,

    Dedmon Dai

17 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    If the totals in your table are correct, you can just put those same measures (or columns with same aggregation selections) into a card visual (either separate single cards or all into the same multi-card visual.

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

      Sorry I am not really sure how to go about aggregation using calculations.  My intentions of using the card is to place it next to a graph I have already calculated and list it as such:

       

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Click on an open area on your report page, then click on the Card visual in the visualizations panel.  If you have measures created, just drag it to the card.  If no, drag the column with those values to the card and choose the appropriate aggregation (probably sum) with the pull-down arrow on that column in the card field well.

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello again.  I have done what you have advised, however, the card is not showing me a percentage much less the amount that I have caclulated within the Excel document.

      I did drag the "Utilization for Chargeability Details (Not Including Partners) into the card and it is showing me this number.  If I do change it to a percentage format, it would show me this:

       

       

      Please advise.  What am I doing that is wrong?  Thank you again for all of your help.  I am sorry that I keep bothering you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello all.

    I am sorry for doing this but I am bumping this request for the reason that I really need to complete my dashboard.  If there is anyone that could help me with this matter I would really appreciate it.  This is the only thing that is pending to be honest.


    Thank you all for your help and have a great day.

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

    Hi Anonymous ,

     

    What's the last column(Utilisation % (Excluding Partners),Utilisation % (Including Partners) )in your table visual? Just put these two measure or column into card visual.

     

    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

      It won't allow me to put the percentage.  I need 2 cards on the dashboard page.  One that represents the % of utlilization including partners and one card without partners.  However, when I do try to drag the column onto the card, it would give me this:

      Can you see the 4.58?

       

      And even if I convert it into a percentage format, it would give me this:

       

      Also, I used the formula (=E4/(C4+E4) as an example) to find the utlilization percentage.

      I would definately mark the issue as resolved once I recieve an answer.  Thank you again

       

       

       

       

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

    Hi Anonymous ,

     

    It's better that you can show us sample pbix file by onedrive for business , so we can help you more correctly.

     

    Best Regards,

    Dedmon Dai

    • Anonymous's avatar
      Anonymous
      Not applicable

      This is the Excel document that I am using to build my dashboard

       

      Also here is a screenshot of the pbix while I try to input the column for utlization within the card.

       

       

       

      Please let me know what exactly what else you need from the pbix file (I am sorry I am a bit new to the whole Power Bi experience and I was just taught the basics.  The rest I am learning from other materials, this wonderful community and YouTube).

       

      Thanks again

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

    Hi Anonymous ,

     

    Create the following  measure and put it in the card visual:

     

     

    Measure = CALCULATE(Your table name[
    Utilisation for Chargeability Detail(Include Partners)],Your table name[
    Operating Unit] = "Grand Total")

     

     

    Best Regards,

    Dedmon Dai

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      First off, I want to thank you for taking this amount of time in helping me try to resolve this issue.  I really appreciate it.

       

      I have tried your suggestion and it gave me this result.  What I would like it to be is a % total which would be 68% (utilization percentage exluding partners) and 66% (utilization percentage including partners).

       

      With the measurement you provided, I recieved this:

      Thanks again.

      • Anonymous's avatar
        Anonymous
        Not applicable

        The image did not show up for some reason.  Let me try it again:

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      Giving me errors

       

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

    Hi Anonymous ,

     

    Your table name means actual table name in your data model.

    Measure = CALCULATE('Chargeability Detail by OU'[
    Utilisation for Chargeability Detail(Include Partners)],'Chargeability Detail by OU'[
    Operating Unit] = "Grand Total")

     

    Best Regards,

    Dedmon Dai

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello.  I have revised the equation as advised, but is now giving me a different error:

       

      I am going to include this for references perhaps I am missing something too. 

      This is the Excel file that I am working on.  Its one of many tabs labaled, "Chargeability Details by OU"

       

      And this is my file in Power Bi

       

      Again, I am so sorry that this is taking a long time.  I am still new at this and really enjoy learning from all of you.  Thank you for all of your help.  I am sorry if this request is bothering some of you.  I deeply apologize.


      Thank you again for helping.  You are going above and beyond to help me learn.  I deeply appreciate it.

       

       

       

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

    Hi Anonymous ,

     

    Use the following measure:

     

    Measure = CALCULATE(MAX('Chargeability Detail by OU'[
    Utilisation for Chargeability Detail(Include Partners)]),'Chargeability Detail by OU'[
    Operating Unit] = "Grand Total")

     

    Best Regards,

    Dedmon Dai