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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Oliya
Frequent Visitor

dax problem

Hi,
I am trying to solve a problem through dax. currently there is duplicate data in my table and requirement is not to delete the duplicate records because if the user filters based on country they should see the correct result. Sample data is below

Contract Novolumetypecountry
111110originalsingapore
111110reportingnetherland
222215originalvietnam


the o/p should be for contract no 1111 total volume should be 10. 
for singapore volume should be 10 similarly for netherland volume should show 10.

for both singapore and netherland volume should be 10. There can be max 2 lines of a contract(original,reporting) or 1.
how i can get the correct sum using dax?

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

 Hi, @Oliya 

According to your description, you want to get the total of the [volume] accoding to your logic.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create two measures:

Measure = MAXX('Table','Table'[volume])
Measure 2 = SUMX(VALUES('Table'[Contract No]) ,[Measure])

(3)Then we can put the [Measure 2] and the fields on the visual and then we can meet your need:

vyueyunzhmsft_0-1675045391300.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

4 REPLIES 4
v-yueyunzh-msft
Community Support
Community Support

 Hi, @Oliya 

According to your description, you want to get the total of the [volume] accoding to your logic.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create two measures:

Measure = MAXX('Table','Table'[volume])
Measure 2 = SUMX(VALUES('Table'[Contract No]) ,[Measure])

(3)Then we can put the [Measure 2] and the fields on the visual and then we can meet your need:

vyueyunzhmsft_0-1675045391300.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Oliya
Frequent Visitor

Spoiler
The measure will be used in table with contract no and with country slicer.

Oliya
Frequent Visitor

total should show as 25.

FreemanZ
Super User
Super User

hi @Oliya 

Measure rely heavely on context. How are you going to use the measure?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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