PowerBI 将日期合并或查找到日期范围(没有共享键变量)
对于 PowerBI 中的模糊连接问题,有几个相关的答案 - 允许评估范围内的日期。请参阅:Power 查询合并两个例如,基于两个日期之间的交易日期的表。
我的挑战是我有一个日期范围列表和一个日期列表,但没有共享键变量,例如上面示例中的“EmpID”,所以我的数据集看起来像:
Dates
2020-01-01
2021-01-01
2022-01-01
的日期范围如下:
Date_Start Date_End Clasifier
2019-01-01 2019-01-02 A
2019-12-31 2020-01-02 B
2020-01-01 2020-01-02 A
2020-01-01 2024-01-01 C
我 如何询问给定日期(第一个表)是否在 DAX 或 M 中的至少一个范围(第二个表)内?如果有一个方法,它是否可以返回日期,也许是重叠的日期范围,以及与该日期范围关联的相关分类器?
There are several, related, answers to the question of fuzzy joins in PowerBI - allowing for dates within ranges to be assessed. See: power query merge two tables based on the transaction date between two dates for example.
My challenge is that I have a list of date ranges, and a list of dates, but no shared key variable, e.g. "EmpID" in the above example, so my datasets look like:
Dates
2020-01-01
2021-01-01
2022-01-01
and my date ranges are like these:
Date_Start Date_End Clasifier
2019-01-01 2019-01-02 A
2019-12-31 2020-01-02 B
2020-01-01 2020-01-02 A
2020-01-01 2024-01-01 C
Is there a way to ask if a given Date (first table) is within at least one of these ranges (second table) in DAX or in M? If there is a method, can it return the date, perhaps the over-lapping date range, and the relevant classifier associated with the date range?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在仅限日期的表的前端创建一个计算列,假设仅限日期的表是 Table1,分类器表是 Table2
Create a calculated column in the front end inside of the Dates only table lets say dates only table is Table1 and Classifier table as Table2