Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a list of dates for each month
for example
Date Value
01/Jan/2023 15
12/Jan/2023 25
25/Jan/2023 37
01/Feb/2023 48
15/Feb/2023 51
28/Feb/2023 57
06/Mar/2023 64
10/Mar/2023 68
31/Mar/2023 74
01/Apr/2023 83
18/Apr/2023 90
26/Apr/2023 87
07/May/2023 87
24/May/2023 104
I wanted to have a table with only Max date for each particular month in power query editor
Solved! Go to Solution.
pls try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc29CoUwDIbhe8ksNEl/HV0cBK+gOCi4ipzNu7cYe0hdH/LmyxmQzLQehpEtdEAeli4DsUYWZK/RxgdLPu5bRZck9xo9SZ4afPNg5vVXMTjJsUH5aUljdHV9OP+YrORJY4+yHprLdz2Wn9cH2WkkLEvLDQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Year-Month", each Date.EndOfMonth([Date])),
#"Grouped Rows" = Table.Group(#"Added Custom", {"Year-Month"}, {{"Count", (x)=> Table.FromRecords({ Table.Max(x,"Date")})}}),
#"Removed Other Columns" = Table.SelectColumns(#"Grouped Rows",{"Count"}),
#"Expanded Count" = Table.ExpandTableColumn(#"Removed Other Columns", "Count", {"Date", "Value"}, {"Date", "Value"})
in
#"Expanded Count"
pls try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc29CoUwDIbhe8ksNEl/HV0cBK+gOCi4ipzNu7cYe0hdH/LmyxmQzLQehpEtdEAeli4DsUYWZK/RxgdLPu5bRZck9xo9SZ4afPNg5vVXMTjJsUH5aUljdHV9OP+YrORJY4+yHprLdz2Wn9cH2WkkLEvLDQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Year-Month", each Date.EndOfMonth([Date])),
#"Grouped Rows" = Table.Group(#"Added Custom", {"Year-Month"}, {{"Count", (x)=> Table.FromRecords({ Table.Max(x,"Date")})}}),
#"Removed Other Columns" = Table.SelectColumns(#"Grouped Rows",{"Count"}),
#"Expanded Count" = Table.ExpandTableColumn(#"Removed Other Columns", "Count", {"Date", "Value"}, {"Date", "Value"})
in
#"Expanded Count"
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
78 | |
59 | |
35 | |
33 |
User | Count |
---|---|
100 | |
62 | |
56 | |
47 | |
41 |