The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello everyone,
I have a table which has 15 columns. 7 columns have data that I need to do calculation on them. I need to find the percentage of filled fields in those 7 fields. for example, let's say in row 1 of the table 3 of 7 columns are filled out so I will have (3/7)*100 = 42.86%
I need to have this percentage for each row and add a column to my table to display the persentage. Please assist me.
Thanks.
@aliasadivet to start with, your data model could probably be improved. Instead of having seven columns of data, maybe header fields coupled with Field, Value. Made up data to illustrate the point...
Header1 | Header2 | Measure1 | Measure2 | Measure3 |
ABC | 1.0 | 43.7 | 64.4 | 94.9 |
ABC | 2.0 | 23.8 | 80.5 | 35.5 |
ABC | 3.0 | 22.4 | 46.5 | 64.9 |
ABC | 4.0 | 80.4 | 67.9 | 56.2 |
ABC | 5.0 | 16.5 | 85.1 | 3.2 |
DEF | 1.0 | 28.5 | 6.5 | 63.5 |
DEF | 2.0 | 38.4 | 30.2 | 17.7 |
DEF | 3.0 | 79.1 | 39.4 | 47.1 |
DEF | 4.0 | 83.3 | 73.4 | 42.3 |
DEF | 5.0 | 98.5 | 38.6 | 11.1 |
DEF | 6.0 | 85.0 | 77.8 | 85.3 |
Try this
Header1 | Header2 | Measure | Value |
ABC | 1 | 1 | 43.7 |
ABC | 2 | 1 | 23.8 |
ABC | 3 | 1 | 22.4 |
ABC | 4 | 1 | 80.4 |
ABC | 5 | 1 | 16.5 |
DEF | 1 | 1 | 28.5 |
DEF | 2 | 1 | 38.4 |
DEF | 3 | 1 | 79.1 |
DEF | 4 | 1 | 83.3 |
DEF | 5 | 1 | 98.5 |
DEF | 6 | 1 | 85.0 |
ABC | 1 | 2 | 64.4 |
ABC | 2 | 2 | 80.5 |
ABC | 3 | 2 | 46.5 |
ABC | 4 | 2 | 67.9 |
ABC | 5 | 2 | 85.1 |
DEF | 1 | 2 | 6.5 |
DEF | 2 | 2 | 30.2 |
DEF | 3 | 2 | 39.4 |
DEF | 4 | 2 | 73.4 |
DEF | 5 | 2 | 38.6 |
DEF | 6 | 2 | 77.8 |
ABC | 1 | 3 | 94.9 |
ABC | 2 | 3 | 35.5 |
ABC | 3 | 3 | 64.9 |
ABC | 4 | 3 | 56.2 |
ABC | 5 | 3 | 3.2 |
DEF | 1 | 3 | 63.5 |
DEF | 2 | 3 | 17.7 |
DEF | 3 | 3 | 47.1 |
DEF | 4 | 3 | 42.3 |
DEF | 5 | 3 | 11.1 |
DEF | 6 | 3 | 85.3 |
@aliasadivet after you alter the data model, it should be easier to determine which of the seven measures are present or not.
Thank you!
I just solved my issue using INT function. NewColumn = (INT('Table'[field1])+...INT('Table'[field7]))/7