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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Moha_shanti
Regular Visitor

Employee Available report

I have 2 tables

  • 1st table has 3 columns are the employee ID, Month and available hours.
  • 2nd table has alos employee ID, Month, work orders acutal hours and more data.

the key record in both table is employee ID

I want to create a visual table having Available hours ans Work order actual hours per employee and month, like below 

MonthEmployee IDWork order actual hoursAvailable Hours
October12345610020
November3216545010
2 REPLIES 2
v-jincheng-msft
Community Support
Community Support

Hi @Moha_shanti ,

Thanks for the information you have given.

Please try the add Collum operation on 1st Table using the following DAX after checking the table name and column name:

 

Work order actual hours = SUMX(FILTER(all('Table_2'),'Table_2'[employee ID]=EARLIER(Table_1[employee ID])),'Table_2'[Work order actual hours])

vjinchengmsft_0-1703211035239.png

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Joseph Ji

 

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

123abc
Community Champion
Community Champion

To create a visual table in Power BI that shows both available hours and work order actual hours per employee and month, you'll need to perform a series of steps that involve merging the two tables and then creating a table visualization. Here's a step-by-step guide:

  1. Import Data:

    • Ensure you've imported both tables into Power BI.
  2. Relationships:

    • Make sure there's a relationship established between the two tables based on the Employee ID and Month columns.
  3. Merge Queries:

    • Go to the Home tab in the Power BI Desktop.
    • Click on Edit Queries to open the Power Query Editor.
    • Select the first table, then choose Merge Queries.
    • In the dialog box, choose the second table and select the matching columns (Employee ID and Month).
    • Ensure you select a type of join that retains all rows from both tables. This is important because you want to ensure you capture all available hours and work order actual hours.
  4. Expand the Merged Table:

    • After merging, you'll see a new column that contains a table. Click on the double-arrow icon at the column header to expand it.
    • Select the columns you want to keep: Employee ID, Month, Available hours, and Work order actual hours.
  5. Create a Table Visualization:

    • Once back in the main Power BI window, click on the Insert tab.
    • Choose Table from the Visualization pane to add a new table visualization to your report canvas.
    • Drag and drop the fields (Month, Employee ID, Work order actual hours, and Available hours) into the table visualization.
  6. Format the Table (Optional):

    • You can further format the table by adjusting column headers, resizing columns, or applying custom styles as per your requirements.
  7. Filter (Optional):

    • If you want to filter the data by a specific month or any other criteria, you can use slicers or filters available in Power BI.
  8. Refresh Data:

    • Ensure that your data refresh settings are correctly configured if you need the report to update automatically with new data.

By following these steps, you should be able to create a visual table in Power BI that displays both available hours and work order actual hours per employee and month based on the two tables you have.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Kudoed Authors