Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
My table has following structure:
In this table, if a combination of country and case have multiple weapons involved, the value shall be contained in those multiple rows(for example the 200 in row 2 and 3 here). However, I want to be able to create a table visual that gives the sum of the value per country, taking into account that only the distinct values per country and case should be summed up.
Table should look like this:
Germany 300
Belgium 200
Netherlands 100.
I'd like to use a calculated measure for this, but not sure how to code it. Can someone help me?
Regards,
Sander
Solved! Go to Solution.
Hi @Anonymous
Try this
Totals = SUMX ( SUMMARIZE ( Country, Country[Country], Country[Case], "Value", DISTINCT ( Country[Value] ) ), [Value] )
Replace Country by your tablename.
Cheers
CheenuSing
Hi @Anonymous
Try this
Totals = SUMX ( SUMMARIZE ( Country, Country[Country], Country[Case], "Value", DISTINCT ( Country[Value] ) ), [Value] )
Replace Country by your tablename.
Cheers
CheenuSing
Hi @Anonymous ,
I forgot to add the following lines.
Now create a table visual with Country and Totals
You will get your desired result.
Cheers
CheenuSing
@Anonymous hi can you explain the rule a bit better, why for germany is it only 300 and not 400? there doesnt seem to be a clear rule for which row you want if there is more than one.
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
102 | |
84 | |
79 | |
68 |
User | Count |
---|---|
120 | |
110 | |
94 | |
81 | |
77 |