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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
BenCha
Regular Visitor

Top 5 non conformities with text data

Hey guys,

I'm starting with Power Bi and I'm learning and enjoying it a lot, but I don't know all the possibilities of this tool.

For work purpose I need to do a report about the non conformities in audits.

I'm trying to pull the Top 5 non conformities based on the number of "Non Conforme" in each of the 34 questions numbered from 1. to 34.

One issue is the export from the software (that I can't modify) is exporting some text that the auditors are adding when there is a non conformities in the same cell. For this I managed to create an extra column for each non conformities where I take only the "Non conforme" part. So I managed to clean a bit.

 

But then I don't know how to be able to sort the non conformities by number of "Non conforme" in the column. I'd use the count.if in excell but not possible in Power BI.

I still need the Site info, date and other info that are removed in the excell file for privacy reasons, to be able to filter.

The first column is a unique number per audit so one line is one audit.

Find below the link to the file, a SC of the file and the kind of report I would like to have.

Tell me if you ahe any questions:

Classeur1.xlsx

 

BenCha_0-1733297697021.png

BenCha_1-1733298423725.png

BenCha_2-1733298505162.png

 

 

 

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @BenCha ,

 

(1) Select the 34 problem columns in Power query and click on Unpivot Columns.->Then add a conditional column.->Click on "close and apply"

vtangjiemsft_0-1733369868938.png

vtangjiemsft_1-1733369885566.png

 

(2) We can create measures.

Count_Non = COUNTROWS(FILTER('Table', 'Table'[Custom]="Non Conforme"))
Rank = RANKX(SUMMARIZE(ALLSELECTED('Table'),[N°],"count",[Count_Non]),[Count_Non],[Count_Non],DESC,Dense)
Flag = IF([Rank]<=5,1,0) 

(3) Place [Flag=1] on the visual object.

vtangjiemsft_2-1733370078100.png

If I have misunderstood you, please clarify in a follow up reply with an example of your expected output.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

View solution in original post

2 REPLIES 2
AnkitKukreja
Super User
Super User

Hi! @BenCha 

 

Do you have ranking against this data? If not then add additional column in Power query, index should work or if you have any order that you need, use conditional column. Then in table view use sort option and choose sort by your (number column).

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
https://topmate.io/ankit_kukreja
v-tangjie-msft
Community Support
Community Support

Hi @BenCha ,

 

(1) Select the 34 problem columns in Power query and click on Unpivot Columns.->Then add a conditional column.->Click on "close and apply"

vtangjiemsft_0-1733369868938.png

vtangjiemsft_1-1733369885566.png

 

(2) We can create measures.

Count_Non = COUNTROWS(FILTER('Table', 'Table'[Custom]="Non Conforme"))
Rank = RANKX(SUMMARIZE(ALLSELECTED('Table'),[N°],"count",[Count_Non]),[Count_Non],[Count_Non],DESC,Dense)
Flag = IF([Rank]<=5,1,0) 

(3) Place [Flag=1] on the visual object.

vtangjiemsft_2-1733370078100.png

If I have misunderstood you, please clarify in a follow up reply with an example of your expected output.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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