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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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