The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear all,
I'm doing a lab with Power BI, using DAX studio connect to my dataset in power BI. I could get the result when write the dax code in dax studio, but It got failure when I try this measure with Power BI, could someone assist me ?
below is the code in DAX studio and it could get the correct result
EVALUATE
var temp =
SUMMARIZE(all_data1,all_data1[Illness],"SUM",SUMX(all_data1,all_data1[Paid amount]))
return
TOPN(10,temp,[SUM],DESC)
Here is the measure which I tried with Power BI , it said "The expression refers to multiple columns. Multiple columns can not be convert to a scalar value"
top10 =
var temp =
SUMMARIZE(all_data1,all_data1[Illness],"SUM",SUMX(all_data1,all_data1[Paid amount]))
return
TOPN(10,temp,[SUM])
Solved! Go to Solution.
hi @Anonymous
DAX studio returns a table, while a measure returns a scalar/single value. That is the issue. So in a measure definition, the outmost or last function is typically count/sum(x)/min/max.
hi @Anonymous
DAX studio returns a table, while a measure returns a scalar/single value. That is the issue. So in a measure definition, the outmost or last function is typically count/sum(x)/min/max.
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
8 |