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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors