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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Data formatting and arrangement

Hi

I am new to power BI and i am trying to automate a particular output and simultaneouly trying to visualise insights from my data. I am successful in creating the visuals but stuck in creating the below output.

Input data format

Below is a dummy of a my data set (input) and the format will remain consistant. Column 'Selection' will be added in the input file, wherein i will be selecting some of the entries (highlighted as A, B, C and D). The second row (Office) will remain consistant and is important to my input.

SelectionFirst NameLast NameDepartmentSalarySource
OfficeABCCorpNA  
 JamesButtAccounting$44,000Internal
AJosephineDarakjyPayroll$42,000Internal
 ArtVenereCommunication$49,000Internal
BLennaPaprockiResearch$58,000Internal
 DonetteFollerFinance$62,000Internal
CSimonaMorascaReal Estate$75,000External
 MitsueTollnerGoodwill$55,000External
DLeotaDilliardMarketing$60,000External
 SageWieserCustomer Service$40,000External

 

and see below the kind out i desire in a table format so that it can be exported from Power BI.

In the below output, i am unable to automate the "minimum, maximum and average rows" (the order of min, max and average should be the same) and the "source row". These will be dynamic and if there is any change in the data, it will automatically update.

SelectionFirst NameLast NameDepartmentSalary
AJosephineDarakjyPayroll$42,000
BLennaPaprockiResearch$58,000
CSimonaMorascaReal Estate$75,000
DLeotaDilliardMarketing$60,000
   Minimum$42,000
   Maximum$75,000
   Average$58,750
OfficeABCCorp  
Source: Internal and External  

 

PLease confirm if there is a way to do it.

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@Anonymous - I'm honestly not sure what you are going for here. Are you trying to do this via Power Query or are you trying to create a table visualization? Power BI is not generally used to transform one ugly, awfully formatted set of data into an even uglyier, even more awful set of data spit out as a text file?? You may have the wrong tool if that is what you are going for. I can't figure out what is up with the blank rows, etc. quite honestly. You are using different columns for different things. That is a trainwreck. Probably be better off using Perl to text parse it from what I can tell or take whatever software is generating it or needs it for input out into field somewhere and beat it with a baseball bat ala Office Space until it commit die.

 

With all that said, there actually is a way to do it. I attached the PBIX below sig. Table (14) and Table 5.

Table 5 = 
    VAR __Office = MAXX(FILTER('Table (14)',[Selection]="Office"),[Selection])
    VAR __First = MAXX(FILTER('Table (14)',[Selection]="Office"),[First Name])
    VAR __Last = MAXX(FILTER('Table (14)',[Selection]="Office"),[Last Name])
RETURN
    SELECTCOLUMNS(
        UNION(
            FILTER('Table (14)','Table (14)'[Selection]<>"Office"),
            { 
                ( "","","","Minimum",MIN('Table (14)'[Salary]),CONCATENATEX('Table (14)',[Source]," and ")),
                ( "","","","Maximum",MAX('Table (14)'[Salary]),CONCATENATEX('Table (14)',[Source]," and ")),
                ( "","","","Average",AVERAGE('Table (14)'[Salary]),CONCATENATEX('Table (14)',[Source]," and ")),
                ( __Office,__First,__Last,"","","" ),
                ( "Source: " & CONCATENATEX(DISTINCT('Table (14)'[Source]),[Source]," and "),"","","","","")
            }
        ),
        "Selection",[Selection],
        "First Name",[First Name],
        "Last Name",[Last Name],
        "Department",[Department],
        "Salary",[Salary]
    )

Greg_Deckler_0-1599351346942.png

 

I feel like I need to go take a shower after providing this solution... 😛



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks Greg.

I understand it might not be a right tool for this but as mentioned earlier, it is only part of the work. Most of the visuals are complete and it was a small portion which cannot be moved out of PBI and has to be adjusted.

 

Thanks for the assist, I will try the soultion.

@Anonymous - Any verdict?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors