Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jprousseau
Frequent Visitor

Measure not adding correctly

Hi 

 

i have measure not tally corectly.

Measure =
SUMX
(
VALUES (data[Contract] ),
CALCULATE ( AVERAGE( (data[Premium] ) )
)
)

 

The premium for the 1st 2 rows must only be added once.

 

Please see screenshot. 

 

jprousseau_0-1621853443636.png

@amitchandak @Angith_Nair 

1 ACCEPTED SOLUTION

Hi @jprousseau ,

 

Try the following measure:

Measure_new1 = 
var _summarize=SUMMARIZE('data',[Date].[Year],[Date].[Month],"1",[Measure_new])
return
IF(
HASONEVALUE(data[Date].[Month]),[Measure_new],SUMX(_summarize,[1]))

v-henryk-mstf_0-1622103057529.png

 

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-henryk-mstf
Community Support
Community Support

Hi @jprousseau ,

 

According to your mistake, I did a test to get the correct result, refer to the following:

Measure_new = 
VAR _summarize =
    SUMMARIZE ( 'data', [User], [Contract], "1", [Measure] )
RETURN
    IF ( HASONEVALUE ( data[User] ), [Measure], SUMX ( _summarize, [1] ) )

v-henryk-mstf_0-1622016480818.png

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-henryk-mstf 

 

Thanks for your help. The measure works now but when i use it in a month breakdown it is still wrong.

 

maybe just something small. i have uploaded the pbix again to https://drive.google.com/drive/folders/11BrpV3LsGQGiZNJHG70y4lLHxoEaA2Ku

 

Thanks

 

jprousseau_0-1622033509488.png

 

Hi @jprousseau ,

 

Try the following measure:

Measure_new1 = 
var _summarize=SUMMARIZE('data',[Date].[Year],[Date].[Month],"1",[Measure_new])
return
IF(
HASONEVALUE(data[Date].[Month]),[Measure_new],SUMX(_summarize,[1]))

v-henryk-mstf_0-1622103057529.png

 

 

Best Regards,
Henry

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@jprousseau 
Try this way:

 

Measure =
SUMX
(
 data,
  data[Premium]  
)

 

 

If you need to average:

 

Measure =
AVERAGEX
(
 data,
  data[Premium]  
)

 




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Get this error

jprousseau_0-1621863119987.png

 

 

@jprousseau 

Can you explain what you are trying to calculate? share a sample of our data.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.