在卡片视觉上总结创建的度量 [英] Summing up the Created Measure on a Card Visual

查看:24
本文介绍了在卡片视觉上总结创建的度量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的数据,

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表,

I have a PBI Table produced like this,

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中创建的度量-使用类似这样的方法.

On the table Last_Processed_Date is a Measure Created in PBI - using something like this.

Last_Processed_Date = calculate (max(processed_date),filter(table1, app_num = selectedvalue(app_num)

Day Diff是用类似这样的度量写的.

Days Diff is written as a measure using something like this.

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.

There is a parameter slicer, that is passed that will select the required days diff and it ranges from 1 to 100.

在这种情况下,用户选择了3.

In this case, the user has selected 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的值将按预期进行相应的更改.

So, upto now it works and produces the table like above and it is dynamic when the user adjusts the Input parameter - the value of MyMeasure changes accordingly as expected.

但是现在,我想制作一个卡片视觉效果,上面写着"2".这不过是MyMeasure的总和或预期日期差异中带有的App_Numbers的计数.我尝试使用创建的MyMeasure作为卡上的可视级别过滤器来执行此操作,但是它不起作用.我们如何解决此问题?

But now, I want to produce a card visual that says '2'. This is nothing but the Sum of MyMeasure or the count of App_Numbers that is with in the expected date diff. I tried to do this using the created MyMeasure as a visual level filter on the card, but it isn't working. How do we resolve this Issue ?

推荐答案

以下小节将对mymeasure值求和.

Below measure will sum the mymeasure value.

cards_measure = var _APP_NUM = ALLSELECTED(app_table [App_Num])返回SUMX(VALUES(app_table [App_Num]),if(app_table [App_Num] in(_APP_NUM),[MyMeasure],0))

cards_measure = var _APP_NUM = ALLSELECTED(app_table[App_Num]) RETURN SUMX(VALUES(app_table[App_Num]),if(app_table[App_Num]in (_APP_NUM),[MyMeasure],0))

这篇关于在卡片视觉上总结创建的度量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆