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,
I have some sales data per country that I want to show.
But for some countries, I want to group the result.
So if the country is Belgium, Netherlands or Luxembourg the result should show as “Benelux”.
The only requirement is that I need to create a measure, and not a calculated column to achieve this.
From this:
Country Sales amount
Germany 5
Belgium 3
Luxembourg 2
Netherlands 3
To this:
Country Sales amount
Germany 5
Benelux 8
Thanks!
Hi @mrclay82
You can creat a new calculated column (Country New) with IF statment Like
IF ( 'Table'[Country] IN { "Belgium", "Netherlands", "Luxembourg" }, "Benelux", 'Table'[Country] )
Then use the new Country column in the visual.
Hey @tamerj1 !
You have helped me before 🙂
Unfortunatelly I'm restricted to only use a measure to solve this, not a calculated column.
Could you please advise? 🙂
Br
@mrclay82
Yes, but you still can locally create a a disconnected table (Countries) that contains all countries but replacing "Belgium", "Netherlands" and "Luxembourg" with “Benelux”. Use this coulm in the table visual along with the following measure
=
SUMX (
VALUES ( Countries[Country] ),
IF (
Countries[Country] = "Benelux",
CALCULATE (
SUM ( 'Table'[Sales] ),
'Table'[Country] IN { "Belgium", "Netherlands", "Luxembourg" }
),
CALCULATE ( SUM ( 'Table'[Sales] ), 'Table'[Country] = Countries[Country] )
)
)
No I can't:
I need to solve this with a measure only somehow.
@mrclay82
Then the only solution is ask the data owner to add the column for you.
Aren't there any table manipulating function I can use to nest in a measure?
@mrclay82
Of course there are. But that won't get you anywhere. You need a column to slice by in a ny visual. You cannot slice by a measure. This is how Power Bi functions.
Hi @mrclay82 your measure should be Sales = SUM(YourTableName[Sales amount])
YourTableName - is simply your table name. I hope this help
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 |
---|---|
44 | |
28 | |
21 | |
12 | |
8 |
User | Count |
---|---|
74 | |
51 | |
45 | |
16 | |
12 |