cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sabilahmed
Helper II
Helper II

SELECTCOLUMNS in CROSSJOIN to rename a column

Hi guys,

 

Is there a way to use SELECTCOLUMNS in a CROSSJOIN to rename the StartofMonth column so we can make this CROSSJOIN work? See below my DAX and error message:

 

sabilahmed_0-1659743896216.png

 

Contracted & Uncontracted 2 = CROSSJOIN('Contracted & Uncontracted',SUMMARIZE(FILTER('Dim_Calendar','Dim_Calendar'[Date] > MIN('Contracted & Uncontracted'[END_DATE]) && 'Dim_Calendar'[Date] < MAX('Contracted & Uncontracted'[Today + 3 Years])), Dim_Calendar[StartofMonth]))

 

Thanks in advance.

 

S

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try the below if it works.

 

Contracted & Uncontracted 2 =
CROSSJOIN (
    'Contracted & Uncontracted',
    SELECTCOLUMNS (
        SUMMARIZE (
            FILTER (
                'Dim_Calendar',
                'Dim_Calendar'[Date] > MIN ( 'Contracted & Uncontracted'[END_DATE] )
                    && 'Dim_Calendar'[Date] < MAX ( 'Contracted & Uncontracted'[Today + 3 Years] )
            ),
            Dim_Calendar[StartofMonth]
        ),
        "@NewNameStartofMonth", Dim_Calendar[StartofMonth]
    )
)

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.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

Please try the below if it works.

 

Contracted & Uncontracted 2 =
CROSSJOIN (
    'Contracted & Uncontracted',
    SELECTCOLUMNS (
        SUMMARIZE (
            FILTER (
                'Dim_Calendar',
                'Dim_Calendar'[Date] > MIN ( 'Contracted & Uncontracted'[END_DATE] )
                    && 'Dim_Calendar'[Date] < MAX ( 'Contracted & Uncontracted'[Today + 3 Years] )
            ),
            Dim_Calendar[StartofMonth]
        ),
        "@NewNameStartofMonth", Dim_Calendar[StartofMonth]
    )
)

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.


Go to My LinkedIn Page


Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors