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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tbobolz
Resolver I
Resolver I

Select multiple items from different slicer - without limiting other columns

I kind of posted this before, but from a different perspective that I could not solve.

 

I have a report connected to a data source that I cannot modify. Each row, or (record) has 5 physician fields. Admitting, Attending, Referring, Surgeon and PCP. 

 

Is it possible to have 5 filters, one for each of these physician fields, so that the user can select the SAME physician from each of these filter so the report returns records if the physician is listed in any one of these field within the data?

 

Or is there another way to return data for the same physician if he/she exits in any one of these fields? I cannot utilize the "ungroup column" as it is connected to a cube I cannot access.

 

I hope I have explained this well.

1 ACCEPTED SOLUTION

Hi @tbobolz,

 

Based on my test, you should be able to follow steps below to get the expected result in your scenario.

 

1. I assume you have a table which has all the Physician names like below. Or you'll need to add one from your source side.

 

t2.PNG

 

2.  Use the Physician column from the table above as Slicer.

 

3. Use the formula below to create a measure to get the selected Physician.

Selected Physician = SELECTEDVALUE(Table2[Physician],BLANK())

4. Use the formulas below to create four measures to recalculate 1-Cases, Charges, Payments, Net Revenue for the selected Physician.

1-Cases for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
COUNTROWS(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician))

Charge for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Charges])

Payments for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Payments])

Net Revenue for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Net Revenue])

5. Then show Entity column with all the five new created measures on your report.

 

r3.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

Can you post your sample data? Seems like you really should unpivot those 5 fields.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I want to create a matrix or similar visual that returns the results shown at the bottom of this reply. If "John" is selected by the user in some manner, the results find and returns "John" in any row or column that his name appears. If it appears more than once per row, like in the first row where it appears 4 times in the same record, I want the result to only count the Cases, Charge, Payment and Net Revenue, once per line.

 

I meant to say Unpivot in my earlier post. However, this is not an allowed option with my data connected to a SQL Server Analysis Service Database, that I do not have access to modify. I attempted the unpivot in a model where I import the raw data myself; however, it seems to multiple the financial with unpivot, but I might have done it incorrectly.

 

Anyways, I perfer to leave it as a SQL model since the data is 10 million rows.

 

Thanks again for looking.

 

EntityPatient Acc #Admitting PhyAttending PhyReferring PhyPrimary Care PhySurgeonMonthYear1-CasesChargesPaymentsNet Revenue
Hospital East200JohnJohnBobJohnJohn92018137008.4114987.0014987.00
Hospital East201MikeMikeJohnMikeDave72018125009.336147.207684.00
Hospital East203SamJohnMikeJohnWendy92018118506.364504.015630.00
Hospital East204SamMikeSallyMikeWendy10201819648.413170.003170.00
Hospital East206JohnSamSuzieSallyLori12018120087.813265.003265.00
Hospital West207SamJohnJohnJohnWendy52018118946.980.005844.24
Hospital West209JohnJohnJohnJohnLori32018112020.325893.005893.00
Hospital West210JohnMikeMikeMikeScott112017121721.7710691.8515843.00
Hospital West212MikeSamSallySallyFrank12017116012.439406.009406.00

 

 

 

Results wanted:

 

EntityPhysician 1-CasesCharegesPaymentsNet Revenue
Hospital EastJohn5100611.9128903.2131566.00
Hospital WestJohn352689.0716584.8527580.24

Hi @tbobolz,

 

Based on my test, you should be able to follow steps below to get the expected result in your scenario.

 

1. I assume you have a table which has all the Physician names like below. Or you'll need to add one from your source side.

 

t2.PNG

 

2.  Use the Physician column from the table above as Slicer.

 

3. Use the formula below to create a measure to get the selected Physician.

Selected Physician = SELECTEDVALUE(Table2[Physician],BLANK())

4. Use the formulas below to create four measures to recalculate 1-Cases, Charges, Payments, Net Revenue for the selected Physician.

1-Cases for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
COUNTROWS(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician))

Charge for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Charges])

Payments for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Payments])

Net Revenue for Selected Physician = 
var selectedPhysician = SELECTEDVALUE(Table2[Physician],BLANK())
return
SUMX(FILTER(Table1,Table1[Admitting Phy]=selectedPhysician||Table1[Attending Phy]=selectedPhysician||Table1[Referring Phy]=selectedPhysician||Table1[Primary Care Phy]=selectedPhysician||Table1[Surgeon]=selectedPhysician),[Net Revenue])

5. Then show Entity column with all the five new created measures on your report.

 

r3.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

Thank you very much for the answer! Sorry for the late response, but have been stuck working something urgent and just now getting back to this.

 

Is it possible to create the "Physician" list from my current source data rather then load another data source into the model. I am working with an SQL Server Analysis Service Database and the option to add extrenal data is grayed-out. I am not sure if that is a condition of the SQL Server or my company has it set that way. I love your other appoarch; however, I am trying to aviod creating a report that will need manually updated each month.

 

Thanks again for your assistance and teaching

 

Terry

 

Thanks for you time! I can't wait to try this out later this week and let you know how it went.

Terry

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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