Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
Sorry for the confusing subject. Basically I have two columns, One with POs and the other with Vendors. I do a count of the vendors against teh POs and there are several of them with multiple vendors. What I want to get is the count of the multiple vendors and single vendors against the POs.
For Example:
PO1 | Count of Vendor |
PO2 | 2 |
PO3 | 3 |
PO4 | 3 |
PO5 | 3 |
PO6 | 1 |
PO7 | 1 |
PO8 | 1 |
PO9 | 1 |
PO10 | 1 |
PO11 | 1 |
What I want to get is the count as to how many times its repated:
Result = 2 is 2 times
3 is 3 times
1 is 6 times
Thanks
Solved! Go to Solution.
If you want a count in Power Query that returns the counts in a table, group by the count column. Returns this table.
1) In Power Query, select New Source, then Blank Query
2) On the Home ribbon, select "Advanced Editor" button
3) Remove everything you see, then paste the M code I've given you in that box.
4) Press Done
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvA3VEAGSjpKRkqxOiAJIzS+MYRrDOWaoPBMUXhmUK2GUL45KtcCTdoSjW9ogC5giBCIBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [POs = _t, Counts = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"POs", type text}, {"Counts", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Counts"}, {{"Count", each Table.RowCount(_), type number}})
in
#"Grouped Rows"
If you want it in DAX, simply put your Counts in a table, tell the visual not to aggregate, then use this measure:
Count of Counts = COUNTROWS('Table')
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi @Anonymous ,
You may create measure or column for the Count of Vendor like DAX below.
Measure= CALCULATE(COUNT(Table1[Vendors]),FILTER(ALLSELECTED(Table1), Table1[Pos] =MAX(Table1[Pos])))
Column= CALCULATE(COUNT(Table1[Vendors]),FILTER(ALLSELECTED(Table1), Table1[Pos]=EARLIER(Table1[Pos])))
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You may create measure or column for the Count of Vendor like DAX below.
Measure= CALCULATE(COUNT(Table1[Vendors]),FILTER(ALLSELECTED(Table1), Table1[Pos] =MAX(Table1[Pos])))
Column= CALCULATE(COUNT(Table1[Vendors]),FILTER(ALLSELECTED(Table1), Table1[Pos]=EARLIER(Table1[Pos])))
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you want a count in Power Query that returns the counts in a table, group by the count column. Returns this table.
1) In Power Query, select New Source, then Blank Query
2) On the Home ribbon, select "Advanced Editor" button
3) Remove everything you see, then paste the M code I've given you in that box.
4) Press Done
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvA3VEAGSjpKRkqxOiAJIzS+MYRrDOWaoPBMUXhmUK2GUL45KtcCTdoSjW9ogC5giBCIBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [POs = _t, Counts = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"POs", type text}, {"Counts", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Counts"}, {{"Count", each Table.RowCount(_), type number}})
in
#"Grouped Rows"
If you want it in DAX, simply put your Counts in a table, tell the visual not to aggregate, then use this measure:
Count of Counts = COUNTROWS('Table')
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |