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
rsbin
Super User
Super User

AddColumns from Another Table

Good Morning,

I need to create a Summary Table.  I've got the first part which is creating a Table with Month End Dates from my Date Table:

 

=
FILTER (
    SELECTCOLUMNS (
        DIM_Date_Slicer,
        "DateKey", DIM_Date_Slicer[DateKey],
        "MonthEndDate", DIM_Date_Slicer[Date],
        Fact
	
    ),
    [MonthEndDate] = EOMONTH ( [MonthEndDate], 0 )
)

 

Kudos to @AIB who provided this code I found in another thread.

I now want to add two columns - ClientName and FacilityName - from a table called 'FactFacilityNames'.  I have not been able to figure out the proper syntax to accomplish this. 

As always, appreciate the help from the Community!

 

Best Regards,

1 ACCEPTED SOLUTION

@selimovd,

Was finally able to solve this with the CROSSJOIN function.  Had to first create an intermediate table with the Distinct Client - Facility combinations I needed.  I'm sure there must be a way to do this in one step.  It may not be the cleanest solution, but at least it works for now.

=CROSSJOIN(
FILTER (
    SELECTCOLUMNS (
        DIM_Date_Slicer,
        "DateKey", DIM_Date_Slicer[DateKey],
        "MonthEndDate", DIM_Date_Slicer[Date] ),
    [MonthEndDate] = EOMONTH ( [MonthEndDate], 0 )),
    FactLiftClientFacility )

 Thanks again for your efforts!

View solution in original post

7 REPLIES 7
selimovd
Super User
Super User

Hey @rsbin ,

 

you can add new columns with the ADDCOLUMNS function:

=
ADDCOLUMNS(
    FILTER(
        SELECTCOLUMNS(
            DIM_Date_Slicer,
            "DateKey", DIM_Date_Slicer[DateKey],
            "MonthEndDate", DIM_Date_Slicer[Date]
        ),
        [MonthEndDate] = EOMONTH ( [MonthEndDate], 0 )
    ),
    "ClientName", [YourMeasureOrFormulaThatReturnsTheRightClient],
    "FacilityName", [YourMeasureOrFormulaThatReturnsTheRightFacility]
)

 

To develop results like this DAX Studio is an amazing help, just wanted to mention that 😉 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

@selimovd,

Thanks for the quick reply, but I don't have a Measure for these other two fields.

For each Month End Date, I need to add each Client and Facility combination.  I think this is where I am still stuck?

ClientFacility
1A
1B
2C
2D
2E

Any additional words of wisdom, please.  And thanks again.

Hey @rsbin ,

 

I don't know your data model.

If you provide more information (PBIX file, data model, tables, relationships) I can help you. But with only your formula I cannot tell you how to add the other tables.

 

Best regards

Denis

@selimovd,

Appreciate the efforts on your part.  It will take me some time to cleanse my model enough so that I can try to post it.  Will let you know once I am able to do so.

Thanks again and Best Regards,

@rsbin Let me know when you're ready. I'm optimistic we can find a solution.

@selimovd,

Here is a simplified view of my model.  Please bear in mind this is an SSAS model that I am working with.

rsbin_0-1628781945905.png

As above, I have created the Month End Dates.  So for each unique combination of Client and Facility (example above), I want to join to my Month End Date.  Final Result expected is:

MonthEndDateClientFacility
1/31/20211A
1/31/20211B
1/31/20212C
1/31/20212D
1/31/20212E
2/28/20211A
2/28/20211B
2/28/20212C
2/28/20212D
2/28/20212E

I hope this provides a clearer picture of what I am after.

Appreciate your patience and thanks again.

 

@selimovd,

Was finally able to solve this with the CROSSJOIN function.  Had to first create an intermediate table with the Distinct Client - Facility combinations I needed.  I'm sure there must be a way to do this in one step.  It may not be the cleanest solution, but at least it works for now.

=CROSSJOIN(
FILTER (
    SELECTCOLUMNS (
        DIM_Date_Slicer,
        "DateKey", DIM_Date_Slicer[DateKey],
        "MonthEndDate", DIM_Date_Slicer[Date] ),
    [MonthEndDate] = EOMONTH ( [MonthEndDate], 0 )),
    FactLiftClientFacility )

 Thanks again for your efforts!

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.

Top Solution Authors