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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bmfokken
Regular Visitor

Combining two GL Accounts under a new column with two different data points

Hello,

 

I have two GL accounts, one for $ amount salary and wages and another for hours for that position. I want to combine these two GL accounts into a single row while still having the two above columns separated. Is there a way I can achieve this?

 

bmfokken_0-1718721329303.png

 

 

 

1 ACCEPTED SOLUTION
v-zhengdxu-msft
Community Support
Community Support

Hi @bmfokken

 

Here for your reference:

Here I create a set of sample:

vzhengdxumsft_0-1718766251489.png

Then click the new table:

vzhengdxumsft_1-1718766301330.png

Table 2 = 
VAR _vtable1 =
    FILTER (
        SELECTCOLUMNS (
            'Table',
            "_AccountID1", 'Table'[AccountID],
            "_Position1", 'Table'[Position],
            "_Actual Amounts1", 'Table'[Actual Amounts],
            "_Actual Total Expenses1", 'Table'[Actual Total Expenses]
        ),
        [_Actual Total Expenses1] <> BLANK ()
    )
VAR _vtable2 =
    SELECTCOLUMNS (
        EXCEPT ( 'Table', _vtable1 ),
        "_AccountID2", 'Table'[AccountID],
        "_Position2", 'Table'[Position],
        "_Actual Amounts2", 'Table'[Actual Amounts]
    )
RETURN
    FILTER (
        CROSSJOIN ( _vtable1, _vtable2 ),
        FIND ( [_Position1], [_Position2], 1, BLANK () )
    )

The result is as follow:

vzhengdxumsft_2-1718766334195.png

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhengdxu-msft
Community Support
Community Support

Hi @bmfokken

 

Here for your reference:

Here I create a set of sample:

vzhengdxumsft_0-1718766251489.png

Then click the new table:

vzhengdxumsft_1-1718766301330.png

Table 2 = 
VAR _vtable1 =
    FILTER (
        SELECTCOLUMNS (
            'Table',
            "_AccountID1", 'Table'[AccountID],
            "_Position1", 'Table'[Position],
            "_Actual Amounts1", 'Table'[Actual Amounts],
            "_Actual Total Expenses1", 'Table'[Actual Total Expenses]
        ),
        [_Actual Total Expenses1] <> BLANK ()
    )
VAR _vtable2 =
    SELECTCOLUMNS (
        EXCEPT ( 'Table', _vtable1 ),
        "_AccountID2", 'Table'[AccountID],
        "_Position2", 'Table'[Position],
        "_Actual Amounts2", 'Table'[Actual Amounts]
    )
RETURN
    FILTER (
        CROSSJOIN ( _vtable1, _vtable2 ),
        FIND ( [_Position1], [_Position2], 1, BLANK () )
    )

The result is as follow:

vzhengdxumsft_2-1718766334195.png

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.