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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
HassanMoosa
Helper I
Helper I

DAX query to find percentage of few categories within column

Hi, can anyone guide me an efficient BI DAX Query to find percentage of only two categories like in my case I want to take percentage of 1 and 2 out of 1-5 scale rating ignoring the missing values in the column, rest all data set to be included. 

 

e.g.: Poor Feedback % = 1(category) + 2(category) / Out of all data set "Excluding missing values" * 100

 

Below is the screenshot of my likert scale and column name. 

 

BL Numeric.PNG

1 ACCEPTED SOLUTION
Mohammad_Refaei
Solution Specialist
Solution Specialist

You can use something like:

Poor Feedback% =
DIVIDE (
    CALCULATE ( COUNTROWS ( 'Table_Name' ), [BL_Numeric] IN { 1, 2 } ),
    CALCULATE ( COUNTROWS ( 'Table_Name' ), [BL_Numeric] <> BLANK () )
) * 100

View solution in original post

8 REPLIES 8
Mohammad_Refaei
Solution Specialist
Solution Specialist

You can use something like:

Poor Feedback% =
DIVIDE (
    CALCULATE ( COUNTROWS ( 'Table_Name' ), [BL_Numeric] IN { 1, 2 } ),
    CALCULATE ( COUNTROWS ( 'Table_Name' ), [BL_Numeric] <> BLANK () )
) * 100

Hi @Mohammad_Refaei  i tried with your query but value is exceding above thousands.  As it should be not greater then 100% i think something is worng while evaluating the expression. 

Thanks @Mohammad_Refaei for the guidance.  Can you please explain the usage of  "<>BLANK ( )" in the second line?

Most welcome Hassan.... The division by <> BLANK() beacause you want to ignore missing values.

 

If the measure is reporting high values then we can be more strict and ignore any other filters like this:

 

Poor Feedback% =
DIVIDE (
    CALCULATE ( COUNTROWS ( ALL('Table_Name') ), [BL_Numeric] IN { 1, 2 } ),
    CALCULATE ( COUNTROWS ( ALL('Table_Name') ), [BL_Numeric] <> BLANK () )
) * 100

 

@Mohammad_Refaei thanks alot for your time and sharing tips.  It's working perectly fine now!

My pleasure @HassanMoosa 

amitchandak
Super User
Super User

@HassanMoosa , Measure in one of three ways

 

divide(countrows(filter(Table, Table[Category] in {1,2})), countrows(filter(Table, nor(isblank(Table[Category])))))

 

divide(countrows(filter(Table, Table[Category] in {1,2})), countrows(filter(allselected(Table), nor(isblank(Table[Category])))))

 

 

divide(countrows(filter(allselected(Table), Table[Category] in {1,2})), countrows(filter(allselected(Table), nor(isblank(Table[Category])))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak  thanks for your inputs.  I tried with your last query but I am facing error that "nor" is not a function.  I tried with false e.g.: 

FALSE(Combine_Feedback[OLE_Numeric]) but this line shows error unexpected parameter.  Thanks for your kind time. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.