Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Radinooo
Regular Visitor

multiple dates in columns for column chart

Hello dear all,

I need help regarding creating column chart for yearly review of parts controls.

My table seems like this:

Parts1st2nd3thproject
Part125.6.201814.7.201821.9.2018Prj1
part225.6.201815.7.201821.9.2018Prj1
Part325.6.201815.7.2018 Prj2
Part425.6.201811.8.201821.9.2018Prj2
Part525.6.201814.7.2018 Prj2
Part615.7.2018  Prj1
Part715.7.201811.8.2018 Prj2
Part815.7.201811.8.2018 Prj1
Part915.7.2018  Prj1
Part1015.7.2018  Prj1
Part1115.7.2018  Prj2
Part1211.8.201821.9.2018 Prj1
Part1311.8.201821.9.2018 Prj1
Part1411.8.201821.9.2018 Prj2
Part1511.8.201821.9.2018 Prj2
Part1611.8.201821.9.2018 Prj1
Part1711.8.201821.9.2018 Prj1
Part1811.8.201821.9.2018 Prj1
Part1911.8.201821.9.2018 Prj2
Part2011.8.201821.9.2018 Prj2

each unique part (in column "Parts") has 3columns for measurements dates, they will be filled continuosly.

Parts are separated to two project "prj1" and "prj2" (column "Project")

Now I want to visualise daily summary of  measuremets for prj1 and prj2.

Is there way to show in one chart how many measurements for prj1 and prj2 was done for each day ?

So from previous image chart will shows:Chart1.jpg

data for chart should be :

Dateprj1prj2total
25.6.2018235
14.7.2018112
15.7.2018538
11.8.20186612
21.9.20187512

 

Thank you

Rado

2 ACCEPTED SOLUTIONS
PattemManohar
Community Champion
Community Champion

@Radinooo Please transform the data as required for the chart in "Power Query Editor", here is the steps I've followed:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZK7DoMwDEV/BXlGVmzyIH/BHjF07YQQ/69SVTTIgRBvHs71PY6SEkyvdSPogR16ZEPjPpPFcMxMGI95Wt8Ec59g2UMsQ+4h9G0aKqHuB/MfthImHG8acshVbika/IVCJ52DgM4axUZ51AWcN8eWejJNFN1T2Y648ozlzkFF22f6ZOJUtFeZBBVd+1olHTXebJro+QM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Parts = _t, #"1st" = _t, #"2nd" = _t, #"3th" = _t, project = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Parts", type text}, {"1st", type date}, {"2nd", type date}, {"3th", type date}, {"project", type text}}),
    #"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"1st", "2nd", "3th"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Only Selected Columns", {"Value", "project"}, {{"Count", each Table.RowCount(_), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Value", Order.Ascending}}),
    #"Pivoted Column" = Table.Pivot(#"Sorted Rows", List.Distinct(#"Sorted Rows"[project]), "project", "Count"),
    #"Inserted Addition" = Table.AddColumn(#"Pivoted Column", "Addition", each [Prj1] + [Prj2], type number),
    #"Renamed Columns" = Table.RenameColumns(#"Inserted Addition",{{"Addition", "Total"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"Value", type date}, {"Prj1", Int64.Type}, {"Prj2", Int64.Type}, {"Total", Int64.Type}})
in
    #"Changed Type1"

The output will be as below :

 

image.png

 

Now, we can create the Chart visual as below (Please note, the "Type" property for x-axis need to be changed as "Categorical")

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

Hello,

 

Thank you for prompt action.

I forgot to say I'm beginner in Power BI (only about 5days of exp.)

But I already successfully modiefied Query settings as you suggested.

It works for me.

 

Thank you

best regards

Rado

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@Radinooo Please transform the data as required for the chart in "Power Query Editor", here is the steps I've followed:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZK7DoMwDEV/BXlGVmzyIH/BHjF07YQQ/69SVTTIgRBvHs71PY6SEkyvdSPogR16ZEPjPpPFcMxMGI95Wt8Ec59g2UMsQ+4h9G0aKqHuB/MfthImHG8acshVbika/IVCJ52DgM4axUZ51AWcN8eWejJNFN1T2Y648ozlzkFF22f6ZOJUtFeZBBVd+1olHTXebJro+QM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Parts = _t, #"1st" = _t, #"2nd" = _t, #"3th" = _t, project = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Parts", type text}, {"1st", type date}, {"2nd", type date}, {"3th", type date}, {"project", type text}}),
    #"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"1st", "2nd", "3th"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Only Selected Columns", {"Value", "project"}, {{"Count", each Table.RowCount(_), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Value", Order.Ascending}}),
    #"Pivoted Column" = Table.Pivot(#"Sorted Rows", List.Distinct(#"Sorted Rows"[project]), "project", "Count"),
    #"Inserted Addition" = Table.AddColumn(#"Pivoted Column", "Addition", each [Prj1] + [Prj2], type number),
    #"Renamed Columns" = Table.RenameColumns(#"Inserted Addition",{{"Addition", "Total"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"Value", type date}, {"Prj1", Int64.Type}, {"Prj2", Int64.Type}, {"Total", Int64.Type}})
in
    #"Changed Type1"

The output will be as below :

 

image.png

 

Now, we can create the Chart visual as below (Please note, the "Type" property for x-axis need to be changed as "Categorical")

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Hello,

 

Thank you for prompt action.

I forgot to say I'm beginner in Power BI (only about 5days of exp.)

But I already successfully modiefied Query settings as you suggested.

It works for me.

 

Thank you

best regards

Rado

@Radinooo That's good !! Happy Learning !!





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.