English 中文(简体)
PowerBI - Row amounting to one table in a direct query
原标题:PowerBI - Row calculation for many to one table in a direct query

我有以下两个表格:应用信息数据库中的应用和应用作用。 申请表中只有一个应用信息数据库,但应用信息数据库在应用作用表中可以存在多个。

Application table:

Application ID ́ ́ ́ «Existing

页: 1

234 页: 1

<>可见>

应用程序设计书

页: 1

页: 1

1234 波尔图

页: 1

234名个人代表

<>0> S I Trial:

Level 1 = IF( App [TBUS] <= 24 && (TRUE) App [NE] = "Existing", (TRUE) IF( SUMX(FILTER( Application Role , App Role [Role] = "PB"(TRUE) && App Role[App Type] = "Individual" (FALSE),1)>0, 1, 0 ), 0 )0 )

我曾尝试过SUMX、MAXX、COUNTROWS。 在上述例子中,该公式应退还1234年的错误,因为应用类型=个人(True)和应用作用的相应价值为“PB”是“False(0)”,但我获得“1”。

任何审查或建议?

问题回答

感谢PBIX。 我假定你在两个表格之间有关系。

如果你确实界定了应用识别编号一栏的关系,你可以使用:

Level 1a = IF(
  ( App [Total] <= 24) && ( App [App Purpose] = "Purchase" ||  App [App Purpose] ="Refinance"),
  IF(CALCULATE(COUNTROWS( App Role ),  App Role [Applicant Type]= "Individual" &&  App Role [Role] = "PB") > 0  ,1,0),0)

否则,你可以使用:

Level 1b = 
  var meId = [App ID]
  var cRows = CALCULATE(COUNTROWS( App Role ),  App Role [App ID] = meId &&  App Role [Applicant Type]= "Individual" &&  App Role [Role] = "PB")
  var result = IF(( App [Total] <= 24) && ( App [App Purpose] = "Purchase" ||  App [App Purpose] ="Refinance"), cRows)
  RETURN IF(result > 0, 1, 0)

你们的逻辑如上,有助于阅读。





相关问题
Power BI Subtotal Measure

I need your help with some Power Bi code As you can see, in the Excel Worksheet i have 2 cells (yellow) that are mainly of subtotals and 2 columns (last 2) that depends of these subtotals, however ...

DAX expression for Power BI measure

I am trying to create a measure in POWER BI, its to calculate the total revenue for a time period but it has a lot of conditions to it. i.e. Total Revenue with following conditions Shipping type = &...

热门标签