Forum Discussion
MAC
9 years agoFrequent Visitor
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...
- 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
Greg_Deckler
Community Champion
9 years agoI created a Measure like so:
River Percent = SUM([Hrs])/CALCULATE(SUM([Hrs]),ALLEXCEPT(Hours,Hours[Vesssel]))
And then a calculated column in Hours table like so:
Oper_Days = [River Percent]*CALCULATE(SUM('Oper Days'[Days]),RELATEDTABLE('Oper Days'))