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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Cross join tables

Hi! 

I need help cross joining two tables. 

 

I have one table that looks like this: 

Table "Openings hours"

 

StoreWeekdayHours open
Store 1Mo8
Store 1Tu7
Store 1We5
Store 1Th10
Store 2Mo4
Store 2Tu3
Store 2We2
Store 2Th1

 

Then I have a Dim Date table:

 

DateWeekday
feb 1 2021Mo
feb 2 2021Tu
feb 3 2021We
feb 4 2021Th

and so on... 

 

I would like to create a new table that gives me the opening hours per date and store: 

 

StoreDateHours open
Store 1feb 1 20218
Store 1feb 2 20217
Store 1feb 3 20215
Store 1feb 4 202110
Store 2feb 1 20214
Store 2feb 2 20213
Store 2feb 3 20212
Store 2feb 4 20211

and so on....

 

I need help with a smart solution! 

 

Cheers! 

Maria

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

In the Query Editor, you can merge Opening Hours table onto the Dim Date table joining on Weekday and then expand the Store and Hours open columns.

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Anonymous , 

Step 1: Join the two tables based on the Weekdays. 

Step 2: Then drag the Stores, date, and hours open from the respective tables on Table visual. 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

If you want to do this in a visual in the report, you can use:

1) 

Sum of hours = SUM('Opening Hours'[Hours open])

2) 

Hours by date =
CALCULATE (
    [Sum of hours],
    TREATAS ( VALUES ( 'Date Table'[Weekday] ), 'Opening Hours'[Weekday] )
)

  and create the visual using the Date field from the Date Table and the Store from the Opening Hours Table:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






AlexisOlson
Super User
Super User

In the Query Editor, you can merge Opening Hours table onto the Dim Date table joining on Weekday and then expand the Store and Hours open columns.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.