这是我的数据,
App_Num Processed_Date State
A1 10 Feb 2021 Open
A1 10 Feb 2021 Closed
A1 22 Feb 2021 Closed
A2 22 Feb 2021 Closed
A2 20 Feb 2021 Closed
A2 21 Feb 2021 Open
A3 20 Feb 2021 Open
A4 20 Feb 2021 Open
A7 20 Feb 2021 Open
我有一个这样制作的 PBI 表,
App_Num Last_Processed_Date Days Diff MyMeasure HasOpenTransactions
A1 22 Feb 2021 2 1 1
A2 21 Feb 2021 3 1 1
A3 20 Feb 2021 4 0 0
A4 20 Feb 2021 4 0 0
A7 20 Feb 2021 4 0 0
在桌子上 Last_Processed_Date 是在 PBI 中创建的度量 - 使用类似这样的东西。
Last_Processed_Date = calculate (max(processed_date),filter(table1, app_num = selectedvalue(app_num)
Days Diff 是使用类似的方法编写的一种度量。
Days Diff = var selected_app_num = selectedvalue(app_num)
var last_processed_date = calculate (max(processed_date),filter(table1, app_num = selected_app_num))
var days_diff_req = datediff(last_processed_date, today(),day)
return days_diff_req
有一个参数切片器,传递的参数将选择所需的天数差异,范围从 1 到 100。
在本例中,用户选择了 3。
MyMeasure = var selected_app_num = selectedvalue(app_num)
var last_processed_date = calculate (max(processed_date),filter(table1, app_num = selected_app_num))
var days_diff_req = datediff(last_processed_date, today(),day)
var required = if(days_diff_req <= selectedvalue(Parameter),1,0)
return required
Today () in the above formula refers to 24/02/2021
所以,到目前为止,它可以像上面一样工作并生成表格,并且当用户调整 Input 参数时它是动态的 - MyMeasure 的值按预期相应变化。
但现在,我想制作一张卡片视觉效果,上面写着“2”。这只不过是 MyMeasure 的总和或 App_Numbers 的计数与预期日期差异。我尝试使用创建的 MyMeasure 作为卡片上的视觉级别过滤器来执行此操作,但它不起作用。我们如何解决这个问题?