另一个表的两个日期之间的日期列表

发布于 2025-02-06 04:56:25 字数 408 浏览 1 评论 0原文

我从另一个表格和今天的表格中创建了两个日期(最小值和最大值)之间的日期列表。

let
  first = List.Min(#"Mizan (Banka&Kasa)"[Tarih]),
  last = List.Max(
{(List.Max(#"Mizan (Banka&Kasa)"[Tarih])), Date.From(DateTime.LocalNow())}
),
howmanydays = Number.From(last) - Number.From(first) + 1,
Source = List.Dates(first, howmanydays, #duration(1, 0, 0, 0))
in
Source

但是我敢肯定,必须有一种更简单的方法来获得此列表。

有什么想法吗?

I created the list of the dates between two dates (minimum and maximum) from another table where i compare the max date and today.

let
  first = List.Min(#"Mizan (Banka&Kasa)"[Tarih]),
  last = List.Max(
{(List.Max(#"Mizan (Banka&Kasa)"[Tarih])), Date.From(DateTime.LocalNow())}
),
howmanydays = Number.From(last) - Number.From(first) + 1,
Source = List.Dates(first, howmanydays, #duration(1, 0, 0, 0))
in
Source

But I am sure there must be an easier way to achieve this list.

Any ideas ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那一片橙海, 2025-02-13 04:56:25

这几乎是它,除非您更喜欢省略howmanydays并使用,

Source = {Number.From(first) .. Number.From(last)}

然后扩展和转换格式到迄今为止

Thats pretty much it, unless you prefer to omit howmanydays and use

Source = {Number.From(first) .. Number.From(last)}

then expand and convert format to date

走野 2025-02-13 04:56:25

如果要使用另一个表的日期创建一个表,也许最好的是:

CREATE NEW TABLE
date = CALENDAR(maxx(table_name, table_name[Date]),TODAY())
  • table_name 是您要选择的表
  • table_name [date] 是您要获得最后日期的单元格

If you want to create a table with the dates of another table maybe the best is:

CREATE NEW TABLE
date = CALENDAR(maxx(table_name, table_name[Date]),TODAY())
  • table_name is the table you want to select
  • table_name[Date] is the cell you want to get the last date
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文