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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sabilahmed
Resolver I
Resolver I

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors