我一直很难找出如何显示比开始日期晚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个月的数据
发布评论