Power Bi DAX:显示开始日期后6个月的数据

编程入门 行业动态 更新时间:2024-10-24 06:37:25
本文介绍了Power Bi DAX:显示开始日期后6个月的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直很难找出如何显示比开始日期晚6个月的数据。

i have been having trouble trying to figure out how to show my data past a date that is 6 months past the start date.

我需要显示值在开始日期之后的6个月之后。

I need to show the values that are after the 6 months past the start date.

每个人的日期都不一样

该公式作为6个月的计算列: + 6m = DATEADD('雇员列表'[Emp。Dates]。[Date],+6,MONTH)

i have the formula as a calculated column for the 6 months: +6m = DATEADD('Employee List'[Emp. Dates].[Date], +6, MONTH)

一项措施将不起作用,因为由于出现错误,我无法将其应用于我的表。

A measure will not work because i cannot apply it to my table as it comes up with an error.

我如何使其工作? 我应该为新公式删除+ 6m列吗?

How do i get it to work? Should i scrap the +6m column for a new formula?

推荐答案

基本度量:

Total Sales = SUM(Sales[Total Sales])

只要您不提供示例数据,它就在猜测您想要的是什么。可能是这样:

As long as you do not provide sample data, it is just guessing what you want. It might be it:

YourMeasure = CALCULATE ( [Total Sales], DATEADD ( 'Employee List'[Emp. Dates].[Date] -- it is better to use here 'Calendar'[Date] -6, MONTH ) )

更新

样本数据:

let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1MAQiJR0lQ6VYHZiQEaaQMaaQCaaQKaaQGaaQOaaQBaaQJYaQoQGmEKbrDdFdb4jpR0NkP8YCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Amount = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Amount", Int64.Type}}) in #"Changed Type"

Measure = var MinDate = CALCULATE( MIN(T[Date]), REMOVEFILTERS(T[Date]) ) var SixMonthAfter = CALCULATE( DATEADD( T[Date], 6 , MONTH ), T[Date] = MinDate ) return CALCULATE( SUM( T[Amount] ), FILTER( T, T[Date] > SixMonthAfter ) )

更多推荐

Power Bi DAX:显示开始日期后6个月的数据

本文发布于:2023-10-30 22:38:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544205.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:个月   日期   数据   Power   Bi

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!