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
Anonymous
Not applicable

Hospital Data Question - NEED HELP ASAP

Hello,

 

I am trying to figure out how to make it so that the fields that state "No Injury Reported" and slots that are completely blank don't show up in the charts and tables that I create in Power BI. Here is a sample of the data I am using. Any immediate assistance would be greatly appreaciated. Please explain any steps that you took to remove them from the charts without deleting it from the Excel Sheet table.

 

Thank you,

CATEGORYLOCATIONNURSE PRESENTOUTCOME
UnanticipatedHEARTNoNo Injury Reported
UnanticipatedHEARTYesNo Injury Reported
UnanticipatedHEARTYesMild / Minor Injury
AccidentalHEARTNoNo Injury Reported
AccidentalHEARTNoMajor
AccidentalHEARTNoNo Injury Reported
UnanticipatedHEARTYesNo Injury Reported
AccidentalHEARTNoMild / Minor Injury
SuspectedHEART/LUNG UNITNoNo Injury Reported
UnanticipatedHEART/LUNG UNITNoNo Injury Reported
AccidentalHEART/LUNG UNITYesNo Injury Reported
AnticipatedHEART/LUNG UNITNoMild / Minor Injury
UnanticipatedHEART/LUNG UNITYesNo Injury Reported
UnanticipatedHEART/LUNG UNITNoMild / Minor Injury
AnticipatedHEART/LUNG UNITNoMild / Minor Injury
AccidentalHEART/LUNG UNITYesNo Injury Reported
UnanticipatedHEART/LUNG UNITNoMild / Minor Injury
UnanticipatedHEART/LUNG UNITNoMild / Minor Injury
AccidentalHEART/LUNG UNITNoNo Injury Reported
AccidentalHEART/LUNG UNITNo 
UnanticipatedHEART/LUNG UNITNoNo Injury Reported
UnanticipatedDAY SURGYesNo Injury Reported
UnanticipatedDAY SURGNoMild / Minor Injury
AccidentalDAY SURGNoMild / Minor Injury
UnanticipatedDAY SURGYesNo Injury Reported
UnanticipatedDAY SURGNoNo Injury Reported
 DAY SURGYesNo Injury Reported
AccidentalDAY SURGNoNo Injury Reported
AccidentalDAY SURGNoNo Injury Reported
AccidentalDAY SURGNoMild / Minor Injury
AccidentalMOTHER BABYNoNo Injury Reported
UnanticipatedMOTHER BABYYesNo Injury Reported
1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my understand , you want to remove the rows when the Outcome is blank or =No Injury Reported and then sort by severity of injury, right?

You could use the following to create a new table:

 

Table 2 =
ADDCOLUMNS (
    FILTER (
        'Table',
        'Table'[OUTCOME] <> "No Injury Reported"
            && 'Table'[OUTCOME] <> BLANK ()
    ),
    "Flag", SWITCH ( [OUTCOME], "Mild / Minor Injury", 1, "Moderate ", 2, "Major", 3 )
)

 

 

Then sort the Outcome column by Flag column

11.13.3.1.gif

 

Here is the pbix file.


Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my understand , you want to remove the rows when the Outcome is blank or =No Injury Reported and then sort by severity of injury, right?

You could use the following to create a new table:

 

Table 2 =
ADDCOLUMNS (
    FILTER (
        'Table',
        'Table'[OUTCOME] <> "No Injury Reported"
            && 'Table'[OUTCOME] <> BLANK ()
    ),
    "Flag", SWITCH ( [OUTCOME], "Mild / Minor Injury", 1, "Moderate ", 2, "Major", 3 )
)

 

 

Then sort the Outcome column by Flag column

11.13.3.1.gif

 

Here is the pbix file.


Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Thank you!! I used the filters before but wasn't sure if there was a way to also remove it from the Excel sheet without ruining how the data is displayed in Power BI. 

 

Is there a way to change the order of a category on a chart?

Example, on the Axis portion of the chart, the Outcome list Major, Mild and Moderate events. It is listing them in alphabetical order but I would like it to be listed as Mild, Moderate and Major. Can that be changed?

 

Thanks again for any assistance!

You have to have a numeric column that defines the sort order you want to use then in your model you set the sort order of the category column by the category_sort column. Here is an article about the subject.
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

jdbuchanan71
Super User
Super User

You can also set a report level filter for outcome and remove BLANK and 'No Injury Reported'.  That way all visuals will be filtered to exclude those rows.

Anonymous
Not applicable

Hi @Anonymous - You can use filters to exclude No Injury reported or Blank.

Click on chart> in filters panel > Outcome is not 'No Injury Reported' etc.

 

Hope this helps.

 

Cheers,

-Namish B 

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.