Forum Discussion

MAC's avatar
MAC
Frequent Visitor
9 years ago
Solved

Percentages

I am a Power BI newbie and am wondering how to best calculate a percentage of some values and then use the percentages in other calculations.   I currently have two data tables:  one for River Oper...
  • v-qiuyu-msft's avatar
    9 years ago

    Hi MAC,

     

    You need to create a calculate column to return Days value from the Oper Days Table in Hours Table:

     

    Days = LOOKUPVALUE('Oper Days'[Days],'Oper Days'[Month_year],'Hours'[Month_year],'Oper Days'[Vesssel],'Hours'[Vesssel])

     

    Then create a calculated column to return Oper_Days:

     

    River Percent = SUM([Hrs])/CALCULATE(SUM([Hrs]),ALLEXCEPT(Hours,Hours[Vesssel],'Hours'[Month_year]))

     

     

    Please check attached .pbix.

     

    Best Regards,
    Qiuyun Yu