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

How to use distinct and get the unique values in created measure (expression) by account name?

Hi Experts ,

I am stuck with the scenario below :

Recently i have applied unpivot columns for few columns to rearrange the rows & attributes.

After that most of the columns are duplicated (expected) , I have fixed few values related to that columns by using DISTINCT dax , but I cannot use the same DISTINCT into the measure which i have created to summing up the values and with using some other measures as below :

Revenue & Margin = SUMX('Delivery Updates',[Revenue*Margin]) --> [Revenue*Margin] is an another measure which result is OK.
The result should be : 51246 euro (1 Account)
But once i did unpivot columns 1 row of account was duplicated as 27 rows with same account name as below :
 
before unpivot :
dinesharivalaga_0-1722433928846.png

after unpivot : (27 rows)

dinesharivalaga_1-1722433962269.png

Now the case is I cannot use DISTINCT to get the 1 Account value from this measure.

Now it is showing below huge number : total 27 rows = 27*51246

dinesharivalaga_2-1722434051305.png
Please help to fix this part asap 😞
Due to this the total margin% is impacted ..
 
Thanks
DK
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Anonymous 

 

As an example, does your sample data look like this?

vzhangtinmsft_0-1722490629432.png

Maybe you can try this formula.

Measure = 
 VAR _table=DISTINCT('Table')
 RETURN
 SUMX(_table,[Value])

vzhangtinmsft_1-1722490685543.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

1 REPLY 1
Anonymous
Not applicable

Hi, @Anonymous 

 

As an example, does your sample data look like this?

vzhangtinmsft_0-1722490629432.png

Maybe you can try this formula.

Measure = 
 VAR _table=DISTINCT('Table')
 RETURN
 SUMX(_table,[Value])

vzhangtinmsft_1-1722490685543.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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