Forum Discussion

Queen_Geek's avatar
Queen_Geek
Icon for Helper I rankHelper I
7 years ago
Solved

I need a % Complete expression!

I can't seem to recreate a formula from excel into DAX.  I need a percent complete like =a1/a2*100. Anyone have any ideas?

 

  • Hi, can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data?

    Column1 Column2 Column3
    A 1.5 6
    B 2.5 4

    As described here:

    How to Get Your Question Answered Quickly 

     

    In general you could just do a measure with DIVIDE (as it handles the DIV/0), based on the table I posted it would look like:

    Ratio = DIVIDE(SUM('Table'[Column2]), SUM('Table'[Column3]))

    for A in rows it will return 0.25, for B it will return 0.625, and for total 0.4

    you can then either multiply it by 100 or format as percent so it would be displayed as 25.0%, 62.5% and 40% respectively

2 Replies

  • Stachu's avatar
    Stachu
    Icon for Community Champion rankCommunity Champion

    Hi, can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data?

    Column1 Column2 Column3
    A 1.5 6
    B 2.5 4

    As described here:

    How to Get Your Question Answered Quickly 

     

    In general you could just do a measure with DIVIDE (as it handles the DIV/0), based on the table I posted it would look like:

    Ratio = DIVIDE(SUM('Table'[Column2]), SUM('Table'[Column3]))

    for A in rows it will return 0.25, for B it will return 0.625, and for total 0.4

    you can then either multiply it by 100 or format as percent so it would be displayed as 25.0%, 62.5% and 40% respectively

    • Queen_Geek's avatar
      Queen_Geek
      Icon for Helper I rankHelper I

      Thank you for getting back to me so quickly.  I finally got it last night! :)  I used the exact expression you suggested.

       

      Also, thank you for pointers on asking questions!