Trying to show Name and there count from multiple columns in Power bi

A9kurs01

New Member
Joined
Jan 24, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I need your help ,I am trying to show Distinct names and there count in Visualization table .

Task is to show names and there count from three columns, It is possible name appears in all three column then count will be 3. If its blank then Ignore.

As shown in below example:

This is how my data looks like.

Name 1Count Name 1Name 2Count Name 2Name 3Count Name 3
Abc Def1Fgh1
Def Fgh1Abc1
Abc1Abc1Abc1
def1Abc Xyz1
Ghi1Def GhI1


I am trying to show names and there count of null as shown in below table.

NameCount
Abc4
Def2
Ghi2
Xyz1



Thanks for your help.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Power Query Solution

Book4
ABCDEFGHIJ
2AbcDef1Fgh1ABC4
3DefFgh1Abc1DEF2
4Abc1Abc1Abc1FGH2
5def1AbcXyz1GHI2
6Ghi1DefGhI1XYZ1
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Replaced Value" = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue,{"Count Name 1", "Count Name 2", "Count Name 3"}),
    #"Uppercased Text" = Table.TransformColumns(#"Replaced Value",{{"Name 1", Text.Upper, type text}, {"Name 2", Text.Upper, type text}, {"Name 3", Text.Upper, type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Uppercased Text",{"Column1"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Columns", "Custom", each if Text.StartsWith([Attribute], "Count") then [Value] else null),
    #"Filled Up" = Table.FillUp(#"Added Custom",{"Custom"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Up", each ([Custom] = 1) and ([Value] <> 1)),
    #"Removed Columns1" = Table.RemoveColumns(#"Filtered Rows",{"Attribute"}),
    #"Grouped Rows" = Table.Group(#"Removed Columns1", {"Value"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Value", Order.Ascending}})
in
    #"Sorted Rows"

this also assumes that conventions like aBc = ABC or similar variations
 
Upvote 1
Solution

Forum statistics

Threads
1,223,371
Messages
6,171,689
Members
452,418
Latest member
kennettz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top