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
moniqueg
Frequent Visitor

Creating a calculated table based off two related tables

Hello,

 

I am struggling to figure out how to create a calculated table based off two other related tables.

 

I have a date table for which i would like to use the month end date as a group and a secondary table of data where i would like to count the rows that fall within the month. 

 

Ie:

table 1 (date table)count of received in the month (table 2)count of closed in the month (table 2)count of assigned in the month (table 2)
30/06/2022506045
31/07/2022657050
31/08/2022402030
30/09/2022205520
31/10/2022354025

 

The date table is linked to table two via the 'actual date' column that is joined to each received date, closed date and assigned date etc.

 

I know exactly how I would/could do this in SQL but DAX is ridiculous. Something so simple is seemingly impossible to me at this point...

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

Jihwan_Kim_1-1664957660472.png

 

Jihwan_Kim_0-1664957637699.png

 

New Table = 
ADDCOLUMNS (
    DISTINCT ( 'Calendar'[End of Month] ),
    "@Received",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Received], 0 ) = 'Calendar'[End of Month] )
        ),
    "@Closed",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Closed], 0 ) = 'Calendar'[End of Month] )
        ),
    "@Assigned",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Assigned], 0 ) = 'Calendar'[End of Month] )
        )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

Jihwan_Kim_1-1664957660472.png

 

Jihwan_Kim_0-1664957637699.png

 

New Table = 
ADDCOLUMNS (
    DISTINCT ( 'Calendar'[End of Month] ),
    "@Received",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Received], 0 ) = 'Calendar'[End of Month] )
        ),
    "@Closed",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Closed], 0 ) = 'Calendar'[End of Month] )
        ),
    "@Assigned",
        COUNTROWS (
            FILTER ( Data, EOMONTH ( Data[Assigned], 0 ) = 'Calendar'[End of Month] )
        )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@moniqueg , You need a date table, Active/inactive joined and userelationship

refer this approch

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.

Top Solution Authors