cancel
Showing results 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.

Helper I

## Measure as Category for Visuals

Hi, I have a requirement which I am not able to solve.

The requirement is.

From the above table, Calculating the "% of Revenue" is percentage of sum of revenue to the grand total Revenue.

measure "Margin Bracket" tells in which bucket does "% of Revenue" falls into.
I have to use "Margin Bracket" measue in X-axis, I will be using it for Clustered Column Chart and Matrix.

1 ACCEPTED SOLUTION
Community Support

You can try the following methods.

``New table = SUMMARIZE(Sheet1,Sheet1[Product],"Sum",SUM(Sheet1[Revenue]))``

Column:

``% = DIVIDE([Sum],SUMX(ALL('New table'),[Sum]))``
``````New Margin Bracket = SWITCH(TRUE(),
[%]<0,"< 0%",
[%]<0.15,"0 - 15%",
[%]<0.30,"15 - 30%",
[%]<0.45,"30 - 45%",
[%]<0.60,"45 - 60%",
[%]>0.60,"> 60%"
)``````

The "New Margin Bracket" can be used as the X-axis.

Is this the result you expect? Please see the attached document.

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.

2 REPLIES 2
Community Support

You can try the following methods.

``New table = SUMMARIZE(Sheet1,Sheet1[Product],"Sum",SUM(Sheet1[Revenue]))``

Column:

``% = DIVIDE([Sum],SUMX(ALL('New table'),[Sum]))``
``````New Margin Bracket = SWITCH(TRUE(),
[%]<0,"< 0%",
[%]<0.15,"0 - 15%",
[%]<0.30,"15 - 30%",
[%]<0.45,"30 - 45%",
[%]<0.60,"45 - 60%",
[%]>0.60,"> 60%"
)``````

The "New Margin Bracket" can be used as the X-axis.

Is this the result you expect? Please see the attached document.

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.

Community Champion

Create a Measure for "% of Revenue": In Power BI, you can create a new measure to calculate the "% of Revenue." The formula might look something like this:

% of Revenue = SUM('YourTable'[Revenue]) / CALCULATE(SUM('YourTable'[Revenue]), ALL('YourTable'))

1. Replace 'YourTable' with the actual name of your table.

2. Create a Measure for "Margin Bracket": Since you already have a measure for "Margin Bracket," ensure it is correctly calculated based on the "% of Revenue." The formula might look like:

Margin Bracket =
SWITCH(
TRUE(),
[YourPercentageMeasure] >= 0 && [YourPercentageMeasure] < 0.2, "Bracket 1",
[YourPercentageMeasure] >= 0.2 && [YourPercentageMeasure] < 0.4, "Bracket 2",
"Other"
)

1. Replace [YourPercentageMeasure] with the actual name of your "% of Revenue" measure.

2. Use "Margin Bracket" in Visualizations:

• For Clustered Column Chart: Place "Margin Bracket" in the X-axis field well, and use other measures (like Revenue or % of Revenue) for the values.

• For Matrix: Add "Margin Bracket" to the Rows or Columns field, and use other measures as needed.

Without the specific details or the sample file, I hope this general guidance helps you set up your visualizations in Power BI. If you encounter any issues or need further assistance, please provide more details or share the sample file for a more accurate solution.

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors