Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OuluChris
Helper I
Helper I

Using a Date Table to relate to another table that doesn't contain dates

Hi,

 

I have two tables in Power Query.

 

The first table contains staff information; Name, Cost Rate, Availability (a decimal number for part-time staff), and expected utilisation. If I multiply these all together I get an average daily cost rate.

 

I also have a calendar table where I've calculated the number of working days (i.e. excluding weekends and public holidays). 1 is a working day and zero is a non-working day.

 

I want a measure that allows me to multiply the cost rate by the number of working days. I will then filter this value by month. Unfortunately, because my first table doesn't contain any dates I can't create a relationship and so when I try to get this information I see an error that says "Relationships between tables may be needed"

 

Is there any way around this?

 

Many thanks,

 

 

Chris

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

You are looking for a CROSSFILTER, a cartesian product of unrelated tables.

 

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

View solution in original post

v-stephen-msft
Community Support
Community Support

Hi @OuluChris ,

 

I try to reproduce.

Here's the sample data.

calendar table

vstephenmsft_2-1638261141398.png

staff information table

vstephenmsft_3-1638261169819.png

 

Try using Table.RowCount and Table.SelectRows in Power Query.

= Table.RowCount(Table.SelectRows(calendar, each [working days] =1))

vstephenmsft_0-1638261048178.png

vstephenmsft_1-1638261094802.png

 

Then you can multiply it easily.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @OuluChris ,

 

I try to reproduce.

Here's the sample data.

calendar table

vstephenmsft_2-1638261141398.png

staff information table

vstephenmsft_3-1638261169819.png

 

Try using Table.RowCount and Table.SelectRows in Power Query.

= Table.RowCount(Table.SelectRows(calendar, each [working days] =1))

vstephenmsft_0-1638261048178.png

vstephenmsft_1-1638261094802.png

 

Then you can multiply it easily.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

You are looking for a CROSSFILTER, a cartesian product of unrelated tables.

 

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors