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
pnem
Frequent Visitor

extract percentage from true/false column

Hi all,

 

I have true/false column data and I want to calculate percentage of those true/false values from subcategory to category.

Here is example of the data. 

 

 

capture.png

 

I want to calculate status column 


Please let me know if you have any advice how to do it 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @pnem ,

 

You can create a column as below:-

STATUS = 
var _true = COUNTROWS(FILTER('Table 2','Table 1'[ID]='Table 2'[ID CAT] && 'Table 2'[STATUS] = 1))
var _total = COUNTROWS(FILTER('Table 2','Table 1'[ID]='Table 2'[ID CAT]))
return DIVIDE(_true,_total,0)

Refer a file below:-

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @pnem ,

 

You can create a column as below:-

STATUS = 
var _true = COUNTROWS(FILTER('Table 2','Table 1'[ID]='Table 2'[ID CAT] && 'Table 2'[STATUS] = 1))
var _total = COUNTROWS(FILTER('Table 2','Table 1'[ID]='Table 2'[ID CAT]))
return DIVIDE(_true,_total,0)

Refer a file below:-

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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!

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.