Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
how to mark every "LAST DATE" in every month using "POWER QUERY"
why "POWER QUERY" because after that it will be "filtered" and "grouped by"
example
Date | Flag
-------------| ----
30/06/2022 | 0
31/06/2022 | 1
01/07/2022 | 0
02/07/2022 | 0
03/07/2022 | 0
...
10/07/2022 | 1 --> today
Solved! Go to Solution.
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
You can create add a custom column as below in Power Query Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VdGxDYAwEEPRXVIjJXZISGZB7L8GokH+5a/uyXffZVRVN7s8xxfO6BlnxsiYGVfGytgZaigYBISgEBiCQ4AIEoEiWAyLuQcshsWwGBbDYlgMi2HpsPSwzIpwRs84M0bGzLgyVsbG0YYiCAhB8T/qeQE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Flag", each if [Date] = Date.EndOfMonth([Date]) or [Date] = Date.From(DateTime.LocalNow()) then 1 else 0)
in
#"Added Custom"
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. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
You can create add a custom column as below in Power Query Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VdGxDYAwEEPRXVIjJXZISGZB7L8GokH+5a/uyXffZVRVN7s8xxfO6BlnxsiYGVfGytgZaigYBISgEBiCQ4AIEoEiWAyLuQcshsWwGBbDYlgMi2HpsPSwzIpwRs84M0bGzLgyVsbG0YYiCAhB8T/qeQE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Flag", each if [Date] = Date.EndOfMonth([Date]) or [Date] = Date.From(DateTime.LocalNow()) then 1 else 0)
in
#"Added Custom"
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. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
You could compare the date field with Date.EndOfMonth(). You may need to play about with converting your current date field to datetime but you should be able to do that in the comparison code.
User | Count |
---|---|
78 | |
74 | |
62 | |
61 | |
45 |
User | Count |
---|---|
108 | |
100 | |
91 | |
83 | |
61 |