cancel
Showing results for
Did you mean:
Frequent Visitor

## Need help to calculate Percentage

Hello,

See below table for your reference.

1. Remove Blanks from the Date Column

2. Remove Blanks from the Amount Column

3. Count total Status. In this case it is 10.

Now I need to calculate percentage to get result as 70%. In this case it will be Total 10 divided by Active (7).

Total Status count is 10 of which 7 are Active status.

1 ACCEPTED SOLUTION
Community Support

Hi @E5254730 ,

Plese try below dax formula:

``````Measure =
VAR TMP =
FILTER (
ALL ( 'Table' ),
[Amount] <> BLANK ()
&& [Date] <> BLANK ()

)
VAR _A =
COUNTROWS ( TMP )
VAR _B =
COUNTROWS ( FILTER ( TMP, [Status] = "Active" ) )
RETURN
DIVIDE ( _B, _A )``````

Please refer the attached .pbix file.

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Community Support

Hi @E5254730 ,

1. below is my test table

Table:

2. cretae  a measure with below dax formula

``````Measure =
VAR TMP =
FILTER (
ALL ( 'Table' ),
[Amount] <> BLANK ()
&& [Date] <> BLANK ()
&& [Satus] <> BLANK ()
)
VAR _A =
COUNTROWS ( TMP )
VAR _B =
COUNTROWS ( FILTER ( TMP, [Satus] = "Active" ) )
RETURN
DIVIDE ( _B, _A )
``````

Please refer the attached .pbix file.

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

When we change few of the Dates (month) it shows 70% for all the months.

See below screen shot. Could not see an option to attach .pbix file.

Community Support

Hi @E5254730 ,

Please try to use card visual.

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

My new data is structured as below. Have added new months i.e. Jan to Dec.

My old data had only one date i.e. May 24th 2023.

Community Support

Hi @E5254730 ,

Plese try below dax formula:

``````Measure =
VAR TMP =
FILTER (
ALL ( 'Table' ),
[Amount] <> BLANK ()
&& [Date] <> BLANK ()

)
VAR _A =
COUNTROWS ( TMP )
VAR _B =
COUNTROWS ( FILTER ( TMP, [Status] = "Active" ) )
RETURN
DIVIDE ( _B, _A )``````

Please refer the attached .pbix file.

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Responsive Resident

Please see the below tutorial and tweak the logic a bit to achieve what you want to.

Count Rows or Sum Columns based on single or Multiple conditions in PowerBI | MiTutorials - YouTube

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors