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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dinesharivalaga
Post Patron
Post Patron

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, @dinesharivalaga 

 

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, @dinesharivalaga 

 

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.