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.
Hi all,
I need a dynamic calculation, that based on filters and slicers always will group countries with less than 1% of revenue as "Other Countries". Otherwise the name of the country should be taken from the Country Name Column.
The Code below is able to find all countries with less than 1% and return that value or the string "Other Countries" depending on what I put into the code.
But I can not return the name of the country with the rest of the code and hope that you can help?
The error message I get, when I try to insert the country is
"A single value for Column "Country Name" in Table DimCountry can not be determined.
This can happen when a measure formula refers to a column that contains many values
without specifying an aggregation such as min max count or sum to get a single result.
Regards
Jørgen
Test Country =
VAR Revenuepct =
CALCULATE (
DIVIDE (
[Total Amount LCY],
[Total Net Sales LCY]
),
FILTER (
DimCountry,
DIVIDE (
[Total Amount LCY],
[Total Net Sales LCY]
) < 0.01
)
)
VAR HighRevenue =
CALCULATE (
DIVIDE (
[Total Amount LCY],
[Total Net Sales LCY]
),
FILTER (
DimCountry,
DIVIDE (
[Total Amount LCY],
[Total Net Sales LCY]
) > 0.01
)
)
RETURN
IF (
Revenuepct < 0,
HighRevenue,
Revenuepct
)
Solved! Go to Solution.
After one day of struggling, I found the code myself:
Hi @Zealand
Thanks for your sharing.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
After one day of struggling, I found the code myself:
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 |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |