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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
PaulDenne
Helper I
Helper I

table filter

Hi

I am new to Power bi

I have a table filtering weekly hours for all staff from daily timesheets into weeks using a date table to get week numbers and sum the hours for the week, and currently highlights any week over 50, and a slider to select which week range they want to look at

 

                  Hours worked

Name          Week 1    week 2

xxxxx               45             54 

 

I want to apply a filter to just show any row that has at least one week over 50 in the range selected, but I get stuck it flters by value of all weeks shown added together

 

many thanks

1 ACCEPTED SOLUTION

Use a "What-if"  numeric parameter for that.

View solution in original post

13 REPLIES 13
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi Ibendlin

 

did you get my reply and sample data, only noticed its not swing on the topic thread?

No. Please try again.

so I have data below in a table

NAME:  hours worked 

                    WK1        wk 2        wk 3

xxx                 50            65           50  

 

want to filter a table to show rows where any column in it is over 55 for hours worked

NameCurrent week Sum of Regular Hours      
ttrob Grxyyxthd42                      48.81     
ttrob Grxyyxthd44                      56.83     
ttrob Grxyyxthd4220.2     
tbzxrthwtb Htddtb43                      12.00     
tbzxrthwtb Htddtb44                         3.00     
tztw Gutdt4223.37     
tztw Gutdt43                      36.08     
tztw Gutdt44                      46.46     
tztw Ptrtrxzgt42                      36.62     
tztw Ptrtrxzgt43                      34.45     
tztw Ptrtrxzgt4448.98     
tztlt Pxtwtb4247.91     
tztlt Pxtwtb43                      50.87     
tztlt Pxtwtb4447.88     
tztlt Pxtwtb43                      11.02     
tzrxtb Woollty4246.24     
tzrxtb Woollty43                      48.80     
tzrxtb Woollty4447.69     
tltb Htywtb4223.51     
tltb Htywtb43                      24.10     
tltb Htywtb43                      11.75     
tltb Htywtb4424.2     
tltb Jtyytry42                      20.12     
tltb Jtyytry44                      20.40     
tltb Wxlkxbd42                      20.02     
tltb Wxlkxbd43                      20.50     
tltb Wxlkxbd44                      20.25     
tltx Kbxght42                      32.55     
tltx Kbxght43                      31.15     
tltx Kbxght4441.77     
twtbzt tttob42                      36.00     
twtlxt Cltrkt42                      22.00     
twtlxt Cltrkt43                      23.02     
twtlxt Cltrkt44                      44.20     
twjtz tlx42                      40.50     
twjtz tlx43                      37.17     
twjtz tlx44                      11.83     
twy wttchtw42                      12.35     
twy wttchtw43                      48.35     
tbzrt Browb42                      27.83     
tbzrt Browb43                      19.07     
tbzrt Browb44                         2.12     
tbzrtw Grxwtd42                      52.35     
tbzrtw Grxwtd43                      51.22     
tbzrtw Grxwtd44                      36.85     
tbzrtw Wtlburtob4422.63     
tbzrtw Wtltob42                      12.00     
tbzrtw Wtltob44                      12.50     
tbzy dwxth4222.05     
tbzy dwxth43                      35.05     
tbzy dwxth44                      11.03     
tbgtlt Ltwrtbct42                      39.86     
tbgtlt Ltwrtbct43                      23.31     
tbgtlt Ltwrtbct44                      24.42     
tbgtlt dttvtbtob42                      47.68     
tbgtlt dttvtbtob42                      11.25     
tbgtlt dttvtbtob43                      43.39     

lbendlin_0-1699565527703.png

 

Hi solved the last step by creating a Measure for Weekly hours current week

Weekly Hours = CALCULATE(SUM('Detailed - Timesheet Report'[Regular Hours]), ALLEXCEPT('Detailed - Timesheet Report', 'Detailed - Timesheet Report'[Name], 'Date'[Current week]) )
 
then populated Table with that measure
 
then created a filter based on your example 
Filter Weekly hours = if(MAXX('Detailed - Timesheet Report',[Weekly Hours])>('Work Limit'[Work Limit Value]),1,0)
 
so greatful for your help

You could also have included the week in the SUMMARIZE.  

I know my downfall, the sample I sent you was the total hours for the week,  but my table builds that total byr sumarising daily regular hours, summarised to that weekly total, so the show filter works perfectly if I say put in 15hrs  it will only show me weeks with any one day in the week range that is over 15, I just need to figure out working it to look at the weekly total

thanks for that, I think i am so close but when I create the work limit table and the measuer then add slicer I dont get the single value option under slicer settings ?

 

thanks for help so far really appreciated

think I see the issue my work table didnt generate the 30-60 range

Use a "What-if"  numeric parameter for that.

many thanks, didn't cover that in my 1 day tutorial 

so last step ..hopefully

I replaced names with my tables and when I add the show filter not data comes for any value, so I have messed up somewhere addin the measuer?

Show =
var a = SUMMARIZE('Detailed - Timesheet Report',[Name])
var b = ADDCOLUMNS(a,"mx",max('Detailed - Timesheet Report'[Regular Hours]))
return if(maxx(b,[mx])>=SELECTEDVALUE('Work Limit'[Work Limit]),1,0)

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors