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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mb0307
Responsive Resident
Responsive Resident

% slider to show % range

Hi all,

 

In my Sales Table,  Sales% is calculated at row level agaisnt the Target column.

 

First visual Table (not Matrix),  shows Product, Sales, Target and % like this:

1.jpg

 

Requirement 1:  I want to show summary of Product and % Range excluding any 0% values, like this:

2.jpg 

 

Requirement 2:  I want to add % Slider for users to slice the data for any % range.   But this should also update the Matrix table % Range.

 

Example:  % Slider set to 50 - 80%

 

Result: 

3.jpg

4.jpg

 

Thanks you in advance. 

1 ACCEPTED SOLUTION

Hi @mb0307 

Not very clear about the result you want. 

You said you have a PRODUCT master dim table with one-2-many relationship to Sales and Other tables. Do you want to filter through the product column in the PRODUCT table ? 

If so, try this.

Measure_edit = 
var _product=SELECTEDVALUE('Product'[Product])
var _filtertable=FILTER(ALL('Sales Table'),'Sales Table'[Product]=_product&&[Column_%]>0)
VAR _minrange=CALCULATE(MIN([Column_%]),_filtertable)
var _maxrange=CALCULATE(MAX([Column_%]),_filtertable)
return FORMAT(_minrange,"Percent")&"-"&FORMAT(_maxrange,"Percent")

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.

View solution in original post

5 REPLIES 5
v-xiaotang
Community Support
Community Support

Hi @mb0307 

Try this.

-

Create a column:

Column_% = DIVIDE('Sales Table'[Sales],'Sales Table'[Target ])

Then, create a measure:

Measure_%_Range =
VAR _filtertable =
    FILTER ( ALLEXCEPT ( 'Sales Table', 'Sales Table'[Product] ), [Column_%] > 0 )
VAR _minrange =
    CALCULATE ( MIN ( [Column_%] ), _filtertable )
VAR _maxrange =
    CALCULATE ( MAX ( [Column_%] ), _filtertable )
RETURN
    FORMAT ( _minrange, "Percent" ) & "-"
        & FORMAT ( _maxrange, "Percent" )

Result:

v-xiaotang_0-1620884126875.png

Please check the sample file I attached below.

 

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.

mb0307
Responsive Resident
Responsive Resident

@v-xiaotang 

 

Exactly what I need but one question which I forgot to add in the post:

 

I have a PRODUCT master dim table with one-2-many relationship to Sales and Other tables, like this::

Screenshot 2021-05-13 164052.jpg

 

Can the measure be tweaked for PRODUCT dim table and all other columns (sales, target and %) are in Sales table.  Highlighted in red below:

'Product'[Product]

 

 

 

Measure_%_Range =
VAR _filtertable =
FILTER ( ALLEXCEPT ( 'Sales Table', 'Sales Table'[Product] ), [Column_%] > 0 )
VAR _minrange =
CALCULATE ( MIN ( [Column_%] ), _filtertable )
VAR _maxrange =
CALCULATE ( MAX ( [Column_%] ), _filtertable )
RETURN
FORMAT ( _minrange, "Percent" ) & "-"
& FORMAT ( _maxrange, "Percent" )

 

Thanks

Hi @mb0307 

Not very clear about the result you want. 

You said you have a PRODUCT master dim table with one-2-many relationship to Sales and Other tables. Do you want to filter through the product column in the PRODUCT table ? 

If so, try this.

Measure_edit = 
var _product=SELECTEDVALUE('Product'[Product])
var _filtertable=FILTER(ALL('Sales Table'),'Sales Table'[Product]=_product&&[Column_%]>0)
VAR _minrange=CALCULATE(MIN([Column_%]),_filtertable)
var _maxrange=CALCULATE(MAX([Column_%]),_filtertable)
return FORMAT(_minrange,"Percent")&"-"&FORMAT(_maxrange,"Percent")

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.

mb0307
Responsive Resident
Responsive Resident

Worked.  Thank you so much for your response. 👍

amitchandak
Super User
Super User

@mb0307 , I doubt this can approched like this. You can have similat buckets like 50-80, not like one is 50-80 and another is 50 -75

 

If you want that then you need have one more column

 

new column =
var _min = minx(filter(Table, [Product] =earlier([product])),[%])
var _max = maxx(filter(Table, [Product] =earlier([product])),[%])
return // * 100 is optional
if(_min = _max, _max *100 & "" , _min & " " & _max)

 

better approch measure bucket

refer my video

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.