Forum Discussion
rsbin
5 years agoCommunity Champion
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_Slice...
- 5 years ago
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!
selimovd
5 years agoMost Valuable Professional
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
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
- rsbin5 years agoCommunity Champion
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?
Client Facility 1 A 1 B 2 C 2 D 2 E Any additional words of wisdom, please. And thanks again.