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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
krpeck
Regular Visitor

Filtering table columns

I'm creating a table report pulling odata from project online. The table has three columns, Location, resident hours and total hours. The resident hours and total hours columns are the same data but I need to filter the resident column to return all the hours related to residents and have the total hours return all hours as you would expect. i'm not sure where to start.

 

I'm hoping someone will point me in the right direction.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@krpeck

 

ResidentTime=Calculate(Sum(Table[hours]),Filter(Table;Table[Role]="resident")

 




Lima - Peru

View solution in original post

3 REPLIES 3

@krpeck I might not understand what you are asking, but I would suggest either providing a sample data set with expected outcome... or What you describe is handled automatically by Power BI.

If you have a table with your resident and hours then the hours are broken out by resident.

If you just dump your total hours by itself in a visual, then it will aggregate and show all hours, or all hours of the residents you pick (if you have residents in a slicer)...


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Sorry I wasn't clear, thank you for your reply.  The table for this report has three columns with data like this

 

Location                        Role                                hours

icu                                Nurse                               12.7

icu                                resident                             6.1

burn                             resident                            10.2

peds                            counsler                               5.0

Phych                           resident                              4.1

burn                             therapist                              5.4

peds                             resident                              2.0

 

From this data I need this report

 

Location                               Resident Time                                 Total Time

icu                                                6.1                                               18.8

burn                                            10.2                                               15.6

Phych                                            4.1                                                 4.1

peds                                              2.0                                                 7.0

 

Since the resident time and the total time come from the same column from the same table, how do I apply a filter to just the one resident column?

 

 

 

 

 

Vvelarde
Community Champion
Community Champion

@krpeck

 

ResidentTime=Calculate(Sum(Table[hours]),Filter(Table;Table[Role]="resident")

 




Lima - Peru

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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