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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sam_gift
Helper I
Helper I

Measure as Category for Visuals

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

The requirement is.

sam_gift_0-1701893152016.png

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.

I have added the link of  the sample pbi file. Please help.
https://drive.google.com/file/d/1FamafchyS7EesRNazhbzGHjaGBRIsg6e/view?usp=drive_link

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @sam_gift 

 

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%"
)

vzhangti_0-1702263972795.png

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

vzhangti_1-1702264056588.png

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.

 

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @sam_gift 

 

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%"
)

vzhangti_0-1702263972795.png

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

vzhangti_1-1702264056588.png

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.

 

123abc
Community Champion
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",
-- Add more conditions as per your requirements
"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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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