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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
GeorgeColl
Helper II
Helper II

Ordering on a non-base table - Report Builder

Hi,

 

Apologies that this may be very straight forward but I cannot find any documentation or resource online. I have a table that is a union of two other tables, both containing an "Inception Date" field. I want to order my results of this table by the inception date, is this possible?

 

This is what I have currently tried

VAR __DS2Core =
		UNION(__DS0Core, __DS1Core)

EVALUATE
	 __DS2Core

ORDER BY
	'__DS2Core'[Inception Date] Desc

I have also tried without '__DS2Core' and it runs but does not order how I expect it to.

 

1 ACCEPTED SOLUTION
SamsonTruong
Solution Supplier
Solution Supplier

Hi @GeorgeColl 

Can you try the following query to order your fields. As a note, this solution will require you to explicitly define which fields you need from the union in the SELECTCOLUMNS() section:

EVALUATE
VAR __DS2Core =
    UNION(__DS0Core, __DS1Core)
RETURN
    SELECTCOLUMNS(
        __DS2Core,
        "Inception Date", [Inception Date],
        -- add all columns needed from __DS2Core
    )

ORDER BY
    [Inception Date] DESC

 
Please let me know if this achieves your desired result.

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

View solution in original post

2 REPLIES 2
v-nmadadi-msft
Community Support
Community Support

Hi @GeorgeColl  ,
Thanks for reaching out to the Microsoft fabric community forum.

You can use this DAX code

CombinedTable =

    UNION(

        SELECTCOLUMNS(__DS0Core,

            "Name", __DS0Core[Name],

            "Inception Date", __DS0Core[Inception Date]

        ),

        SELECTCOLUMNS(__DS1Core,

            "Name", __DS1Core[Name],

            "Inception Date", __DS1Core[Inception Date]

        )

    )


to create a combined table between the first two tables.

In the table visual you can sort by descending order by clicking on epsilon.

vnmadadimsft_0-1749231375683.png

 

I have shared the pbix file for reference as well.


If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you

SamsonTruong
Solution Supplier
Solution Supplier

Hi @GeorgeColl 

Can you try the following query to order your fields. As a note, this solution will require you to explicitly define which fields you need from the union in the SELECTCOLUMNS() section:

EVALUATE
VAR __DS2Core =
    UNION(__DS0Core, __DS1Core)
RETURN
    SELECTCOLUMNS(
        __DS2Core,
        "Inception Date", [Inception Date],
        -- add all columns needed from __DS2Core
    )

ORDER BY
    [Inception Date] DESC

 
Please let me know if this achieves your desired result.

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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