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
Anonymous
Not applicable

ETL in Power BI Desktop

I am currently facing a problem in finding a suitable DAX formula for resolving an issue. 

 

ERP report provides information in the format below. It lists all GL first and then cost centre as a sub-total row. 

 

GL Amount
9000 10000
9001 20000
1010 30000
9002 1000
9005 2000
1011 3000

 

I want to transform my table in the format below

 

GL Cost Centre Amount
9000 1010 10000
9001 1010 20000
1010 1010 30000
9002 1011 1000
9005 1011 2000
1011 1011 3000

 

Appreciate if anyone can help

1 ACCEPTED SOLUTION

@Anonymous

 

File attached as well

 

ETL.png


Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Give this a shot.

 

First Add an Index Column from Query Editor

 

Then add this calculated column

 

Cost Centre =
VAR GL_Character = 9
VAR Cost_Centre = 1
RETURN
    IF (
        VALUE ( LEFT ( [GL] ) ) = GL_Character,
        MINX (
            TOPN (
                1,
                FILTER (
                    Table1,
                    [Index] > EARLIER ( [Index] )
                        && VALUE ( LEFT ( [GL] ) ) = Cost_Centre
                ),
                [Index], ASC
            ),
            [GL]
        ),
        [GL]
    )

Regards
Zubair

Please try my custom visuals

@Anonymous

 

File attached as well

 

ETL.png


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you @Zubair_Muhammad It worked

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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