Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I have below table in power BI
MatchA MatchB MatchC
Row1 SAME DIFFERENT BLANK
Row2 SAME SAME BLANK
Row3 SAME SAME DIFFERENT
I need to create report output like below:
Sr. SAME DIFFERENT BLANK
MatchA 3 0 0
MatchB 2 1 0
MatchC 0 1 2
Please advise how can I achieve this in power BI and also the option to drill down to records based on criteria (e.g. Clicking on 3 will show all 3 records and so on)
Thanks for your support.
Solved! Go to Solution.
Hi @abhi139
Try this in query editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsovN1TSUQp29HUFUi6ebm6uQa5+IUC2k4+jn7dSrA5YjRFCDZRCkTbGkEaYFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ROW = _t, MatchA = _t, MatchB = _t, MatchC = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ROW", type text}, {"MatchA", type text}, {"MatchB", type text}, {"MatchC", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ROW"}, "Attribute", "Value")
in
#"Unpivoted Columns"
Try measure as:
Measure 2 =
CALCULATE(
COUNT('Table'[Value]),
FILTER(
'Table',
'Table'[Attribute]=MAX('Table'[Attribute])
))
Here is the output:
The pbix file is attached.
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @abhi139
Try this in query editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsovN1TSUQp29HUFUi6ebm6uQa5+IUC2k4+jn7dSrA5YjRFCDZRCkTbGkEaYFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ROW = _t, MatchA = _t, MatchB = _t, MatchC = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ROW", type text}, {"MatchA", type text}, {"MatchB", type text}, {"MatchC", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ROW"}, "Attribute", "Value")
in
#"Unpivoted Columns"
Try measure as:
Measure 2 =
CALCULATE(
COUNT('Table'[Value]),
FILTER(
'Table',
'Table'[Attribute]=MAX('Table'[Attribute])
))
Here is the output:
The pbix file is attached.
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
I suggest to unpivot the Table in Power Query and create a table to get the result
follow this video to understand that https://drive.google.com/file/d/1Yk_neCzTsKlJFMGRVuRqVz4fFOG9wAJl/view?usp=sharing
Proud to be a Super User!
HI @VijayP
Many thanks for the quick solution - this is very close to what i was looking for.
However, Is there any way i can drill -down in the matrix to see actual data? i.e. if i click/drill down on 2 (Blanks) for Match C, it shows the Row1 and Row2 table record?
Actually Match columns are the comparison between other columns (i didnt added those columns in my oriingal question).
the objective is to show the differences (count of SAME,BLANKS,DIFFERENT) as well as ability to view the records of the count shown in the matrix.
Many thanks once again.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
121 | |
111 | |
59 | |
57 |