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
jnn4282
Helper II
Helper II

Percentage ranges in slicer

I am working with the project to control the cost and improve the revenue.
For example, Total sales for this FY were 1M, Labor was 25%, COGS was 28.5%, and so on.
My concern is, " I will create a slicer with the range of 0-0.5%,0.5-1%,1-1.5% up to 5%.
If I select a 1-1.5% value, the Labour and COGS should be 24-23.5% and 27.5-27%, respectively.

Would anybody guide me, please?

1 ACCEPTED SOLUTION

Thank you so much for your valuable time.
I want my dashboard with a card for Sales, Profit, COGS, and Labor with 0%(the original).
If I can control COGS and Labor by 0-0.5% or 1-1.5%  the  Profit number should increase and LABOR and COGS should decrease.

Hope this explanation makes clear .
thank you in advance.

View solution in original post

15 REPLIES 15
v-kkf-msft
Community Support
Community Support

Hi @jnn4282 ,

 

Not sure about your data structure, I created the following example data.

 

vkkfmsft_1-1646184754434.png

 

Then we need to create a new table for the slicer.

 

Slicer = 
ADDCOLUMNS (
    GENERATESERIES ( 0, 4.5, 0.5 ),
    "RangeEnd", [Value] + 0.5,
    "Range",
        [Value] & "-" & [Value] + 0.5 & "%"
)

vkkfmsft_0-1646184739040.png

 

Then create meatures to calculate the minimum and maximum values respectively.

 

Minrate = SUM( 'Table'[rate] ) - SELECTEDVALUE ( Slicer[RangeEnd] ) / 100
Maxrate = SUM ( 'Table'[rate] ) - SELECTEDVALUE ( Slicer[RangeStart] ) / 100

vkkfmsft_2-1646184866775.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jnn4282_0-1646192278228.png

This is what I am working on.
I created a slicer measure as per your instruction. Tabel with category and rate doesn't need to create, since I am pulling data from  P&L. My concern is by selecting slicer created, the profit may change. By decreasing the COGS and Labor by 0.5 % how much the impact has on Profit.
I hope my question is clear.
Thanks in advance for supporting me.

Hi @jnn4282 ,

 

Do you mean that COGS%, Profit, Labor% are columns in the table? If so, are these columns summed in these cards?

 

vkkfmsft_0-1646211877180.png

 

I see that Profit + COGS% + Labor% <> 100%, so how is Profit calculated?

 

I assume that these values are summed and Profit = 1 - COGS% - Labor% - Other%, then the following measures can be created to show the filtered results.

 

Max_COGS% = SUM('P&L'[COGS%]) - SELECTEDVALUE(Slicer[RangeStart])/100 
Min_COGS% = SUM('P&L'[COGS%]) - SELECTEDVALUE(Slicer[RangeEnd]) / 100

Max_Labor% = SUM('P&L'[Labor%]) - SELECTEDVALUE(Slicer[RangeStart]) / 100
Min_Labor% = SUM('P&L'[Labor%]) - SELECTEDVALUE(Slicer[RangeEnd]) / 100

Max_Profit = 1 - [Min_COGS%] - [Min_Labor%] - SUM('P&L'[Other%])
Min_Profit = 1 - [Max_COGS%] - [Max_Labor%] - SUM('P&L'[Other%])

vkkfmsft_1-1646213215401.png

 

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Did you get a chance to look at my data, which I attached as link P&L?

@jnn4282 
The link you've provided is not working, You can upload to WeTransfer for example and share the link within your reply.

Dear @tamerj1 
Thank you for your response.

I have sent a link below so that you can check my data.

https://we.tl/t-1omTtL3XkJ

 

Please help me 

Hi @jnn4282 ,

 

I still don't understand how you want to calculate the Profit value after the range change. For example, I choose 1-1.5% and then calculate the maximum and minimum values for COGS% and Labor%.

 

How do you then want to calculate the Profit value? As the formula shows, I am not sure what the TotalResult value is. If it is still 203663214, then you only need to add 2% to the original Profit. If not, what should it be?

Could you please give a detailed example?

 

Screenshot 2022-03-07 165711.png

 

Best Regards,
Winniz

Hi Winniz,

Here is the link to my Power bi file.

 

https://we.tl/t-5GEUQf4Kgd

Hi @jnn4282 ,

 

If we select 0.5-1%, is this the output you expect?

 

Screenshot 2022-03-09 161341.png

 

Best Regards,
Winniz

You are my hero.

This is what I want. Thanks a lot and I will definitely remember you if I need more support.

Thank you so much for your valuable time.
I want my dashboard with a card for Sales, Profit, COGS, and Labor with 0%(the original).
If I can control COGS and Labor by 0-0.5% or 1-1.5%  the  Profit number should increase and LABOR and COGS should decrease.

Hope this explanation makes clear .
thank you in advance.

P&L  

I don't know its proper way to share the data or not. My data is as attached. 
I did understand your response a lot. My data structure is a bit complicated. The subject column is the main focus point. With this data, I want to show how the number changes if we reduce COGS and Labour by a certain percentage.

@v-kkf-msft 
By the way, thank you so much for your time and sincerity. I really appreciated your time and dedication. I am quite new to power bi.

amitchandak
Super User
Super User

@jnn4282 , You should be able to use what is slicer

 

You can two value from range in a measure =

measure =

var _min = minx(allselected(whatif), whatif[value])

var _max = maxx(allselected(whatif), whatif[value])

return

<use those >

 

What if

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear @amitchandak ,

Thank you so much for your prompt response.

I am new to Power Bi and not able to sort out your description.
Creating a measure with min and max var and after the function allselected  , I dont know what next?

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.