Forum Discussion
Percentages
- 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
Thank you!
Can I still use ALLEXCEPT if I have more than one layer of date data?
| Hours Table: | Oper Days Table | ||||||
| Month_year | Vesssel | River | Hrs | Month_year | Vesssel | Days | |
| Jan-16 | James | Red | 400 | Jan-16 | James | 31 | |
| Jan-16 | James | Yellow | 100 | Jan-16 | Peter | 31 | |
| Jan-16 | James | Blue | 125 | Feb-16 | James | 29 | |
| Jan-16 | James | Green | 119 | ||||
| Jan-16 | Peter | Red | 250 | ||||
| Jan-16 | Peter | Yellow | 150 | ||||
| Jan-16 | Peter | Blue | 100 | ||||
| Jan-16 | Peter | Green | 244 | ||||
| Feb-16 | James | Red | 130 | ||||
| Feb-16 | James | Yellow | 180 | ||||
| Feb-16 | James | Blue | 250 | ||||
| Feb-16 | James | Green | 136 | ||||
| River_Days: - Desired | |||||||
| Month_year | Vesssel | River | Oper_Days | ||||
| Jan-16 | James | Red | 16.66666667 | ||||
| Jan-16 | James | Yellow | 4.166666667 | ||||
| Jan-16 | James | Blue | 5.208333333 | ||||
| Jan-16 | James | Green | 4.958333333 | ||||
| Jan-16 | Peter | Red | 10.41666667 | ||||
| Jan-16 | Peter | Yellow | 6.25 | ||||
| Jan-16 | Peter | Blue | 4.166666667 | ||||
| Jan-16 | Peter | Green | 10.16666667 | ||||
| Feb-16 | James | Red | 5.416666667 | ||||
| Feb-16 | James | Yellow | 7.5 | ||||
| Feb-16 | James | Blue | 10.41666667 | ||||
| Feb-16 | James | Green | 5.666666667 |
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
- MAC9 years agoFrequent Visitor
Thanks so much!!!!!