平时工作中经常会遇到Group By 的情形,用sql 写group by 很容易,在PBI中可以这样写:
SUMMARIZE(表名,GroupBy Key ,"聚合列命名",DISTINCTCOUNT(_campaignactions[OfferKey]))
复杂点可以在groupby后做筛选:
CALCULATE(DISTINCTCOUNT(_campaignactions[CampaignKey] ),FILTER(SUMMARIZE(_campaignactions,_campaignactions[CampaignKey],"ID",DISTINCTCOUNT(_campaignactions[OfferKey])),[ID]>42499))