Forum Discussion
BOquinn
Mar 08, 2024Copper Contributor
Counting by referencing multiple tables in a single function.
Hello, I'm having troubles figuring out the proper process to count the number of trades that are off on a certain date, using the following tables. There is a table for the Personnel, linke...
BOquinn
Mar 08, 2024Copper Contributor
SergeiBaklan
Mar 08, 2024MVP
If to build PivotTable we need to add source data to data model first. Better to do that with Power Query, but if source tables do not require any transformations that could be done directly.
Also directly in Power Pivot or by Power Query to add Data (aka Calendar) table which covers dates for all desired periods.
Relationships could be set as
Measure to use
WasOff:=CALCULATE(
COUNTROWS( DaysOff ),
TREATAS( VALUES(PeopleTrades[Personnel]), DaysOff[Person] )
)
Resulting PivotTable looks like