March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
How can I get something like this below (different hues of one color) in a clustered column chart.
The month (x-axis) order would change every month. Next month, 05 will be at the end and 06 in the front.
But the color hue order would not change.
Regardless of the x-axis order, the graph will always look like this.
Here is the data:
AGE_GROUP | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Jan | Feb | Mar | Apr |
0-17 | 1.82 | 1.66 | 1.6 | 1.54 | 1.57 | 1.58 | 1.63 | 1.56 | 1.65 | 1.54 | 1.52 | 1.74 |
18-64 | 2.24 | 2.25 | 2.22 | 2.18 | 2.23 | 2.25 | 2.26 | 2.11 | 2.24 | 2.26 | 2.3 | 2.23 |
65 and Over | 2.3 | 2.31 | 2.28 | 2.26 | 2.3 | 2.32 | 2.3 | 2.3 | 2.35 | 2.35 | 2.36 | 2.33 |
Thank you for your help!
Vadivu
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZYw9DoMwDIWvgjxDVNvY+BY9QJQBqV0ZGHr+NnmpRMTiT8/vJ2d6LLzRTJxCGtyBdm0FkLCApVA9aEMSI9tKZc7EsXj9S5IOA6SBA0oHz+Hx0MNT//k67jbtx2t6ft7nxdTei3tP5SpwbUBP//bLFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [AGE_GROUP = _t, #"5/1/2021" = _t, #"6/1/2021" = _t, #"7/1/2021" = _t, #"8/1/2021" = _t, #"9/1/2021" = _t, #"10/1/2021" = _t, #"11/1/2021" = _t, #"12/1/2021" = _t, #"1/1/2022" = _t, #"2/1/2022" = _t, #"3/1/2022" = _t, #"4/1/2022" = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"AGE_GROUP"}, "Month", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Month", type date}, {"Value", type number}})
in
#"Changed Type"
Measure := DATEDIFF(TODAY(),max('Table'[Month]),MONTH)
See attached.
Notes
- your source data is not suitable for Power BI. It needs to be unpivoted (and the year needs to be added).
- I added a measure to produce the gradient
- there is a bug in the current Power BI Desktop that ignores the instruction not to concatenate X axis labels. It is caused by the new format pane. Hopefully they can fix that soon.
Thank you. I am not able to open the attached file. I have Jan 2021 Desktop Power BI version.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZYw9DoMwDIWvgjxDVNvY+BY9QJQBqV0ZGHr+NnmpRMTiT8/vJ2d6LLzRTJxCGtyBdm0FkLCApVA9aEMSI9tKZc7EsXj9S5IOA6SBA0oHz+Hx0MNT//k67jbtx2t6ft7nxdTei3tP5SpwbUBP//bLFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [AGE_GROUP = _t, #"5/1/2021" = _t, #"6/1/2021" = _t, #"7/1/2021" = _t, #"8/1/2021" = _t, #"9/1/2021" = _t, #"10/1/2021" = _t, #"11/1/2021" = _t, #"12/1/2021" = _t, #"1/1/2022" = _t, #"2/1/2022" = _t, #"3/1/2022" = _t, #"4/1/2022" = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"AGE_GROUP"}, "Month", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Month", type date}, {"Value", type number}})
in
#"Changed Type"
Measure := DATEDIFF(TODAY(),max('Table'[Month]),MONTH)
Thank you very much for your assist
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |