Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am having a date filter with values year, month and day. I am having a table with two columns - one with code (it has duplicates) and corresponding productions for the day selected. I tried the following measure but its wrong.
CALCULATE(SUMX(VALUES('WASTAGE'[CODE]), AVERAGE('WASTAGE'[PRODUCTION])))
Can anyone help ?
Solved! Go to Solution.
Hi , I found a working solution to the above problem. Im adding it here just for reference.
NTest =
var x = SUMX(SUMMARIZE(WASTAGE,(WASTAGE[CODE]), "Summ", sum(WASTAGE[PRODUCTION])), [Summ])
var y = count(WASTAGE[PRODUCTION])
return
x/y
NTest1 =
VAR a = VALUES( WASTAGE[CODE] )
VAR Result = SUMX(a,[NTest])
RETURN
IF(HASONEFILTER(WASTAGE[CODE]), [NTest], Result)
Hi @Anonymous
Can you provide more details about the data and expected output? Sample data. The problem statement is not very clear.
Regads
Hi @qqqqqwwwweeerrr , thanks for your response.
Iam having a date filter. On selecting the date I want (4th-jan-2023 here) i want to calculate the total sum of averages of the production wrt to the code i.e ((800+800+.....+800)/7) + ((11776+ 11776+ .....11776)/5) => 800+11776 = 12567
I have tried the following measure ,
Total_production = SUMX(VALUES('WASTAGE'[CODE]), AVERAGE('WASTAGE'[PRODUCTION]))
and im getting 10,746 as the result for the above data which is wrong. Any help is appreciated.
Thanks.
Hi , I found a working solution to the above problem. Im adding it here just for reference.
NTest =
var x = SUMX(SUMMARIZE(WASTAGE,(WASTAGE[CODE]), "Summ", sum(WASTAGE[PRODUCTION])), [Summ])
var y = count(WASTAGE[PRODUCTION])
return
x/y
NTest1 =
VAR a = VALUES( WASTAGE[CODE] )
VAR Result = SUMX(a,[NTest])
RETURN
IF(HASONEFILTER(WASTAGE[CODE]), [NTest], Result)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |