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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Wrong Total in Matrix by using SMX-measure

Hello,

 

I got the following issue. I have to show a table with the values per year and I also have to show the sum of them. 

In order to consider a currency translation I am using the following measure to show the data: 

 
PS IRQ (in target CUR) = SUMX('Product Information','Product Information'[Currency Rate]*sum('Product Information'[Project Specific Cost (in EUR)]))
 
As you can see in the picture my values per year are correct. The issue is that the sum of them is not correct. I do not know how to solve this specific problem. Hopefully some of you got an idea how I have to change my measure so that all values will be correct.

 

BrauTi_1-1647887320920.png

 

 

I would really appreciate your help....!!!!

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @Anonymous, Try this.

PS IRQ (in target CUR) = SUMX('Product Information','Product Information'[Currency Rate]*'Product Information'[Project Specific Cost (in EUR)])
 
Sum is an aggregation, where are SUMX is iterating through each line of the dataset. 
 

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Since there is no specific pbix file for you, you can refer to my similar template data below.

It showed me  2+2=3, on total,but I want to show here 4.

vluwangmsft_0-1648112884729.png

base data:

vluwangmsft_1-1648112948667.png

measure:

visit(cal) = DISTINCTCOUNT(Spending[date])

 

Visit = VAR _table = SUMMARIZE(Spending, Spending[member_number], "distinctcount", DISTINCTCOUNT(Spending[date]))
RETURN
SUMX(_table, [visit(cal)])

 

Final I create another  measure:

test = if(HASONEVALUE(Spending[branch_name]),[visit(cal)],SUMX(DISTINCT(Spending[branch_name]),[visit(cal)]))

Output:

vluwangmsft_2-1648113041053.png

 

You could adjust on my sample .And if question still not solved ,could you pls share your pbix file ,and remember to remove confidential data.

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

 

 

davehus
Memorable Member
Memorable Member

Hi @Anonymous, Try this.

PS IRQ (in target CUR) = SUMX('Product Information','Product Information'[Currency Rate]*'Product Information'[Project Specific Cost (in EUR)])
 
Sum is an aggregation, where are SUMX is iterating through each line of the dataset. 
 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors