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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
carddosogabriel
Frequent Visitor

[Help] - Sumx doesn't count the expression correctly

Good afternoon, everyone, what's up?


I am facing the following problem, I would like to add the total of the formula "Sum PoS L4W", however it is not adding up the way I would like, according to the measure "PoS L4W".


In the current month (e.g. 9) - if the volume > 0 in this month (9) it would add 1, if in the previous month (8) the volume > 0 it would also add 1 for the current month (9).


However, as you can see in the image below, this is not happening.

Formulas:


PoS Presence =
IF([Volume Total]>0,1,0)

PoS Presence vs LM =
CALCULATE(IF([Volume Total]>0,1,0),Table[Mes] = MAX(Table[Mes])-1)

PoS L4W =
IF( ( [PoS Presence]  + [PoS Presence vsLM] )>=1,1,0 )

Soma PoS L4W =
SUMX('MTM FRESH WILD',[PoS L4W])



carddosogabriel_0-1700248786897.png

Can anyone help me understand what's going on?

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

Soma PoS L4W = SUMX(VALUES('MTM FRESH WILD'[SAP]),[PoS L4W])

If not, then share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
carddosogabriel
Frequent Visitor

Works!!!! Thank Youu Ashish_Mathur

 

Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

Soma PoS L4W = SUMX(VALUES('MTM FRESH WILD'[SAP]),[PoS L4W])

If not, then share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.