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

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

Reply
lw24
Helper I
Helper I

Upload an excel table in order to keep specific grouping

Hello All!

 

I've included an excel file but I'm looking for a solution that would allow me to recreate the following table as shown because my stakholders can be very picky...

 

I'm open to any suggestions! 

SectorName Goal  Prorated Goal  Revenue Revenue against Prorated Goal
Asset Wealth ManagementJoe Smith $      100,000 $                50,000 $        40,00080%
Asset Wealth ManagementMichael Young $      200,000 $              100,000 $        10,00010%
AWM Total  $      300,000 $              150,000 $        50,00033%
BankingBruce Wayne $      100,000 $                50,000 $        40,00080%
BankingMr. Freeze $      200,000 $              100,000 $        10,00010%
Banking Total  $      300,000 $              150,000 $        50,00033%
Grand Total  $      600,000 $              300,000 $      100,00033%
1 ACCEPTED SOLUTION

@lw24 

 

How about this?  Go into Power Query (in a blank pbix) and create a blank query.  In Advanced Editor, replace the existing code with:

 

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "i45WciwuTi1RCE9NzCnJUPBNzEtMT81NzStR0lHyyk9VCM7NLMkAshVUFMDA0MBAx8DAAEkEAUwxpUxgQhYGqkqxOvhs881MzkhMzVGIzC/NS0cyxAinjdjcYggTMoRZGO6rEJJfkpgDUoak1Bi3sVj8ARcyNoYY65SYl50JdqdTUWlyqkJ4YmVeKhXDCWG+b5GegltRampVKvUCBWo6LQLGvSgxLwWrwWY4Dca0EuELsLmxAA==",
          BinaryEncoding.Base64
        ),
        Compression.Deflate
      )
    ),
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [
        Sector = _t,
        Name = _t,
        #" Goal " = _t,
        #" Prorated Goal " = _t,
        #" Revenue " = _t,
        #"Revenue against Prorated Goal" = _t
      ]
  ),
  #"Changed Type" = Table.TransformColumnTypes(
    Source,
    {
      {"Sector", type text},
      {"Name", type text},
      {" Goal ", Currency.Type},
      {" Prorated Goal ", Currency.Type},
      {" Revenue ", Currency.Type},
      {"Revenue against Prorated Goal", Percentage.Type}
    }
  ),
  #"Removed Columns" = Table.RemoveColumns(#"Changed Type", {"Revenue against Prorated Goal"}),
  #"Replaced Value" = Table.ReplaceValue(
    #"Removed Columns",
    " ",
    "",
    Replacer.ReplaceValue,
    {"Name"}
  ),
  #"Filtered Rows" = Table.SelectRows(#"Replaced Value", each ([Name] <> "")),
  #"Renamed Columns" = Table.RenameColumns(
    #"Filtered Rows",
    {{" Goal ", "Goal"}, {" Prorated Goal ", "Prorated Goal"}, {" Revenue ", "Revenue"}}
  )
in
  #"Renamed Columns"

 

 

 

Exit Power Query.

 

Next, create these 4 measures:

 

 

Goal = SUM( 'FactTable'[Goal] )

Prorated Goal = SUM( 'FactTable'[Prorated Goal] )

Revenue = SUM( 'FactTable'[Revenue] )

Revenue against Prorated Goal = DIVIDE( [Revenue], [Prorated Goal] )

 

 

 

Next, create a matrix visual and populate it as follows:

Rows: 'FactTable'[Sector], 'FactTable'[Name]

Values:  the 4 measures you just wrote

 

Then its just a matter of setting "+/- icons" to Off and "Stepped Layout" to Off (depending on your preference).  Those settings can be found on the Format pane, under Row Headers (and Row Headers --> Options).

 

ex 1.png



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

12 REPLIES 12
gmsamborn
Super User
Super User

Hi @lw24 

 

Using Power Query, I would filter out all Total records.  Otherwise, you'll have those records added to any totals.

 

You won't need them anyways since Power BI is quite capable of calculating any required totals.

 

(Also, [Revenue against Prorated Goal] can easily be calculated.)

 

I hope this helps.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Thanks for quick reply! To clarify, what I'm looking for is for that information to look like that but in a table visual... Each sector has a total with a grand total of the sector totals at the bottom. 

Hi @lw24 

 

Here is an example of a matrix that should cover your requirement.

 

I didn't use an Excel file, I just copied from your above data.  The procedure to follow is the same.

 

I filtered all rows where [Name] is blank.  I made the assumption that those are Total rows.  Other criteria could just as easily be used.  I also removed [Revenue against Prorated Goal] from the source.

 

After 4 simple measures and moving the sub-totals to below the detail instead of above, your matrix is complete.

 

Matrix Grouping.pbix

 

Let me know if you have any questions.



Proud to be a Super User!

daxformatter.com makes life EASIER!

I'm on a work computer and using work credentials. Not sure I'm able to download this... everytime I click the link it takes me to a One Drive page with an error... 

There's no file in One Drive when I click on the link. 

 

I get a message that says ...

 

lw24_0-1705086000234.png

 

That looks like a firewall at your end.

 

Does this work?

https://www.dropbox.com/scl/fi/5msskcifkfcht3slawmc0/Matrix-Grouping.pbix?rlkey=55qjf8tnoludb48w2y6n...

 

or this?

https://we.tl/t-EcfCx7uRQi

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

I am able to access and initiate the download. However, I'm not able to open because I don't have the latest version of Power BI (which i'm suppose to download from a specific location). My version 2.118.828.0

 

lw24_0-1705087601354.png

 

Hi @lw24 

 

You can get the latest version here.

https://www.microsoft.com/en-us/download/details.aspx?id=58494

 

Also, can you include @gmsamborn  in your reply or I might not see it for a while.



Proud to be a Super User!

daxformatter.com makes life EASIER!

@gmsamborn are screenshots possible? 

@lw24 

 

How about this?  Go into Power Query (in a blank pbix) and create a blank query.  In Advanced Editor, replace the existing code with:

 

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "i45WciwuTi1RCE9NzCnJUPBNzEtMT81NzStR0lHyyk9VCM7NLMkAshVUFMDA0MBAx8DAAEkEAUwxpUxgQhYGqkqxOvhs881MzkhMzVGIzC/NS0cyxAinjdjcYggTMoRZGO6rEJJfkpgDUoak1Bi3sVj8ARcyNoYY65SYl50JdqdTUWlyqkJ4YmVeKhXDCWG+b5GegltRampVKvUCBWo6LQLGvSgxLwWrwWY4Dca0EuELsLmxAA==",
          BinaryEncoding.Base64
        ),
        Compression.Deflate
      )
    ),
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [
        Sector = _t,
        Name = _t,
        #" Goal " = _t,
        #" Prorated Goal " = _t,
        #" Revenue " = _t,
        #"Revenue against Prorated Goal" = _t
      ]
  ),
  #"Changed Type" = Table.TransformColumnTypes(
    Source,
    {
      {"Sector", type text},
      {"Name", type text},
      {" Goal ", Currency.Type},
      {" Prorated Goal ", Currency.Type},
      {" Revenue ", Currency.Type},
      {"Revenue against Prorated Goal", Percentage.Type}
    }
  ),
  #"Removed Columns" = Table.RemoveColumns(#"Changed Type", {"Revenue against Prorated Goal"}),
  #"Replaced Value" = Table.ReplaceValue(
    #"Removed Columns",
    " ",
    "",
    Replacer.ReplaceValue,
    {"Name"}
  ),
  #"Filtered Rows" = Table.SelectRows(#"Replaced Value", each ([Name] <> "")),
  #"Renamed Columns" = Table.RenameColumns(
    #"Filtered Rows",
    {{" Goal ", "Goal"}, {" Prorated Goal ", "Prorated Goal"}, {" Revenue ", "Revenue"}}
  )
in
  #"Renamed Columns"

 

 

 

Exit Power Query.

 

Next, create these 4 measures:

 

 

Goal = SUM( 'FactTable'[Goal] )

Prorated Goal = SUM( 'FactTable'[Prorated Goal] )

Revenue = SUM( 'FactTable'[Revenue] )

Revenue against Prorated Goal = DIVIDE( [Revenue], [Prorated Goal] )

 

 

 

Next, create a matrix visual and populate it as follows:

Rows: 'FactTable'[Sector], 'FactTable'[Name]

Values:  the 4 measures you just wrote

 

Then its just a matter of setting "+/- icons" to Off and "Stepped Layout" to Off (depending on your preference).  Those settings can be found on the Format pane, under Row Headers (and Row Headers --> Options).

 

ex 1.png



Proud to be a Super User!

daxformatter.com makes life EASIER!

I'm not suppose to download applications from outside my company's specific environment. 

@lw24 

 

I guess your hands are tied.  I would try to explain that it is software required for you to do your job.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.