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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
SaaM
Helper II
Helper II

Segment values

Hi,

With this data I would like to create a segment for Distance runned that varies from 0 - 500 but I didn't figure out so far how to do this.

 

My objective is to have a filter that allow to keep all the runners who runs more than N kms in total.

 

SaaM_0-1632473789204.png

 

Thanks in advance

 

Kind regards

Saam

 

1 ACCEPTED SOLUTION

@SaaM , You will not be able to create a bucket using this(what if) . You can create a measure

 

example

 

measure =
VAR _max = MAXX(allselected('Whatif'),'Whatif' [value])
var _min = MinX(allselected('Whatif'),'Whatif' [value])

return
calculate(Sum(Table[ConsumptionCount]), filter(Table, Table[Distance runned]>=_min && Table[Distance runned]<=_max))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @SaaM ;

First you could create a "0-500" table as a slicer. then create a flag measure .

1.create a table 

slicer = GENERATESERIES(0,500,1)

vyalanwumsft_0-1632722596914.png

2.create a flag measure.

flag =
VAR _perruned =
    CALCULATE ( SUM ( [Distance runned] ), ALLEXCEPT ( 'Table', 'Table'[Athlete] ) )
RETURN
    IF (
        _perruned <= MAX ( 'slicer'[Value] )
            && _perruned >= MIN ( 'slicer'[Value] ),
        1,
        0
    )

3.apply it into filter.

vyalanwumsft_1-1632722746222.png

The final output is shown below:

vyalanwumsft_2-1632722784492.pngvyalanwumsft_3-1632722799330.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@SaaM , Create a new column

 

Switch(True(),

[Distance runned] < 500, " 1- 500",

" > 500 "

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Actually I am trying to have something like this to filter the distance runned by each athlete

 

for example the athelte a runned once 200 kms and then 300 kms so he runned 500 kms in total.

 

SaaM_0-1632474858163.png

 

@SaaM , You will not be able to create a bucket using this(what if) . You can create a measure

 

example

 

measure =
VAR _max = MAXX(allselected('Whatif'),'Whatif' [value])
var _min = MinX(allselected('Whatif'),'Whatif' [value])

return
calculate(Sum(Table[ConsumptionCount]), filter(Table, Table[Distance runned]>=_min && Table[Distance runned]<=_max))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.