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
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.

NamishB
Post Prodigy
Post Prodigy

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
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.