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.
Hi All
I have been using this DATE table for some time and been using it for a Sales Table daily refresh.
How do I get the end date to be a dynamic one and not have future dates show in the table
I know there is a DateTime.FixedLocalNow() formula that exists and I dont know where to insert this line in my current date table
Many thanks
See Date Table details below:
= (StartDate as date, EndDate as date, FYStartMonth as number) as table =>
let
DayCount = Duration.Days(Duration.From(EndDate - StartDate)) +1 ,
Source = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),
TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),
ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type date}}),
RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Date"}}),
in
AddFY
Solved! Go to Solution.
Hi @atin ,
You could try like this:
= Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZDLDcUwCAR78TkSBn+pxUr/bQS/KNr1u+EdgxjWSioqltXTtcvy1ve1kgGYmAEUgCrUUJG3Y1ID6MekDjC/cucDuYtmgEnL7hjEiUTlIPGRDGeUll+gbKiDCLmHB/f8QDy2I3UY8pDqAAUgvhOoAC4VeTsUlUg/FQvIYMN9X9P/c8WCCuCHXwHgYzUexcfqxyw+Vih+5H4A", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"start date" = _t, #"end date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"start date", type date}, {"end date", type date}}),
Custom1 = Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
in
Custom1
Hi @atin ,
You could try like this:
= Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZDLDcUwCAR78TkSBn+pxUr/bQS/KNr1u+EdgxjWSioqltXTtcvy1ve1kgGYmAEUgCrUUJG3Y1ID6MekDjC/cucDuYtmgEnL7hjEiUTlIPGRDGeUll+gbKiDCLmHB/f8QDy2I3UY8pDqAAUgvhOoAC4VeTsUlUg/FQvIYMN9X9P/c8WCCuCHXwHgYzUexcfqxyw+Vih+5H4A", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"start date" = _t, #"end date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"start date", type date}, {"end date", type date}}),
Custom1 = Table.SelectRows(#"Changed Type" , each Date.From([end date]) <= Date.From(DateTime.FixedLocalNow()))
in
Custom1
Hi @atin ,
use DAX to create the date table.
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |