首页 > 解决方案 > (Power BI) 将计算列转换为 Power Query

问题描述

这是我拥有的计算列代码,并希望将其转换为 Power Query。

Power BI 计算列

Unique Match Column = 
var consignee=CALCULATE(DISTINCTCOUNTNOBLANK(Client[Consignee]),ALLEXCEPT(Client,Client[ConsolNumber]))
var consignor=CALCULATE(DISTINCTCOUNTNOBLANK(Client[Consignor]),ALLEXCEPT(Client,Client[ConsolNumber]))
var consignee1=CALCULATE(Max(Client[Consignee]),ALLEXCEPT(Client,Client[ConsolNumber]))
var consignor1=CALCULATE(Max(Client[Consignor]),ALLEXCEPT(Client,Client[ConsolNumber]))
var match=SWITCH(TRUE(),
AND(consignor=1,consignee=1),consignee1,
consignee=1,consignee1,
consignor=1,consignor1,
AND(ISBLANK(consignor),consignee<>1),"BLANK",
AND(ISBLANK(consignee),consignor<>1),"BLANK",
"MIX")
return match

这是 pbix:https ://ufile.io/q2pty4w9

希望大家能在这件事上有所帮助。

非常感谢并感谢您的关注。

标签: powerquerypowerbi-desktop

解决方案


推荐阅读