Forum Discussion
shashar11
6 years agoFrequent Visitor
Create calculated column based on another sheet
Hello - I have a spreadsheet with multiple sheets. Sheets 1 has some data . Sheet 2 has a holiday schedule. I need to upload both sheets to the Power BI and create a calculated column called bas...
- 6 years ago
Here is the solution I found:
https://community.powerbi.com/t5/Desktop/WORKDAY-formula-in-Power-BI/td-p/202383
v-alq-msft
6 years agoCommunity Support
Hi, shashar11
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table1:
Table2:
There is no relationship between two tables. You may create two calculated columns as below.
NewColumn1 = LOOKUPVALUE(Table1[ProductName],Table1[ProductID],Table2[PID])
NewColumn2 =
CALCULATE(
SUM(Table2[Sales]),
FILTER(
ALL(Table2),
Table2[PID]=EARLIER(Table1[ProductID])
)
)
Result:
Table1:
Table2:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.