Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I got stuck, looking thru all the chart solution in this forum... still doesn't feel any enlightenment. I am trying to get the total count to appear on my bar chart. I have
- x-axis with the owner name
- y-axis with count of Overdue number
How do I get the total of overdue ( which the count should be total 6) onto that bar chart? Hope to get some pointer from the expert from this forum. Thanks a ton.
Solved! Go to Solution.
Hi @Frozensparrow ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) Click "Transform Data" to enter the Power Query Editor, click "Advanced Editor" to copy and paste the following code, you can check the steps in the right step bar.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitXBznLCwnKGsGIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Owner = _t, OverDue = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Owner", type text}, {"OverDue", Int64.Type}}),
#"Transposed Table" = Table.Transpose(#"Changed Type"),
#"Added Custom" = Table.AddColumn(#"Transposed Table", "Custom", each "Total"),
#"Transposed Table1" = Table.Transpose(#"Added Custom"),
#"Replaced Value" = Table.ReplaceValue(#"Transposed Table1","Total","",Replacer.ReplaceValue,{"Column2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Column2", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "Owner"}, {"Column2", "OverDue"}})
in
#"Renamed Columns"
(3)Click "Close and Apply" and we can create two calculated columns and two measures.
count = COUNTROWS(FILTER('Table','Table'[Owner]=EARLIER('Table'[Owner])))
total = COUNTROWS('Table')-1
Measure = IF(MAX('Table'[OverDue])=BLANK(),MAX('Table'[total]),MAX('Table'[count]))
color = IF(MAX('Table'[Owner])="Total",1,0)
(4)Set the conditional formatting as shown in the following figure.
(5)Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Neeko, you sample pbix allow me to understand better, and give me the idea on the approach. Thank you so much. 🙂
Thanks Neeko, you sample pbix allow me to understand better, and give me the idea on the approach. Thank you so much. 🙂
Hi @Frozensparrow ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) Click "Transform Data" to enter the Power Query Editor, click "Advanced Editor" to copy and paste the following code, you can check the steps in the right step bar.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitXBznLCwnKGsGIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Owner = _t, OverDue = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Owner", type text}, {"OverDue", Int64.Type}}),
#"Transposed Table" = Table.Transpose(#"Changed Type"),
#"Added Custom" = Table.AddColumn(#"Transposed Table", "Custom", each "Total"),
#"Transposed Table1" = Table.Transpose(#"Added Custom"),
#"Replaced Value" = Table.ReplaceValue(#"Transposed Table1","Total","",Replacer.ReplaceValue,{"Column2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Column2", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "Owner"}, {"Column2", "OverDue"}})
in
#"Renamed Columns"
(3)Click "Close and Apply" and we can create two calculated columns and two measures.
count = COUNTROWS(FILTER('Table','Table'[Owner]=EARLIER('Table'[Owner])))
total = COUNTROWS('Table')-1
Measure = IF(MAX('Table'[OverDue])=BLANK(),MAX('Table'[total]),MAX('Table'[count]))
color = IF(MAX('Table'[Owner])="Total",1,0)
(4)Set the conditional formatting as shown in the following figure.
(5)Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
144 | |
73 | |
63 | |
52 | |
51 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |