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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ToastMaker
New Member

Cross Join from a single table

Morning everyone and thanks in advance for your support.

I need to create a table and call it "presence" starting from a single table called Res_Register.

Above mentionned table contains the the column "Res_Code" which represent a single "resource", while in the columns from AF1 to AEP1 are indicated if the resource is present or not. all the columns from AF1 to AEP1 are named as a date.

The table requested shall cross join the Res_Code with all the columns from AF1 to AEP1 and shall have three columns "Date", "Res_Code", and "Presence Type" that is the the value contained in the combination of the Res_Code with the related Day. 

The table shall contain the list of resource present for each day.

1 ACCEPTED SOLUTION
tharunkumarRTK
Super User
Super User

@ToastMaker 

From what I undestand you only need to unpivot the data, follow these steps.

 

  • Load your Res_Register table into Power Query.
  • Select the columns AF1 to AEP1 (all date columns).
  • Use the Unpivot Columns feature:
    • Right-click the selected columns → Choose Unpivot Columns.
  • Rename the new columns:
    • Rename the "Attribute" column to Date.
    • Rename the "Value" column to Presence Type.
  • Format the "Date" column:
    • If the column names AF1, AEP1, etc., are date codes, map or parse them into actual date values

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

 

 

 

View solution in original post

2 REPLIES 2
v-saisrao-msft
Community Support
Community Support

Hi @ToastMaker 
Thanks for posting in Microsoft Forum community. 
 

As per query Cross Join from a single table I've worked through your query and applied the logic to sample data for better clarity. Below is the approach and the resulting query for transforming the Res_Reregister table into the requested Presence table: 
 

Below is the sample data have taken based on your query. 

vsaisraomsft_0-1734417435939.png

 

From above sample data I've created two separate tables Res_code And Date.

vsaisraomsft_1-1734417476582.png

 

 

And perform the cross join between date and rescode table, in power query we don't have cross join instead we use custom column which works as a cross join.

vsaisraomsft_2-1734417509262.png

 

In custom column selects the table which we want to cross join we want to cross join Date with rescode table. 

vsaisraomsft_3-1734417521247.png

After cross join will get a new custom table by selecting the expand (vsaisraomsft_4-1734417543000.png) the contents of this newly created column, and then select OK. 

vsaisraomsft_5-1734417543002.png

 

 

After selecting the res_code from expand column cross join is performed. 

vsaisraomsft_6-1734417553376.png

 

 

 

NOTE: I hope this information is helpful. If you encounter any issues or need further assistance, please feel free to reach out. 

 

tharunkumarRTK
Super User
Super User

@ToastMaker 

From what I undestand you only need to unpivot the data, follow these steps.

 

  • Load your Res_Register table into Power Query.
  • Select the columns AF1 to AEP1 (all date columns).
  • Use the Unpivot Columns feature:
    • Right-click the selected columns → Choose Unpivot Columns.
  • Rename the new columns:
    • Rename the "Attribute" column to Date.
    • Rename the "Value" column to Presence Type.
  • Format the "Date" column:
    • If the column names AF1, AEP1, etc., are date codes, map or parse them into actual date values

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

 

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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