cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper II

## Measure %

How can i create a measure to get the result as shown in the below table? I don't want to use show value as % of grand total.

Table

 Mode Online Offline Online Online Online Offline Offline Offline Offline Offline

Result

 Mode Count Online 4 Offline 6 Mode Percentage Online 40% Offline 60%
2 ACCEPTED SOLUTIONS
Super User

Hello @InsightSeeker ,

You have to create a measure for the same as below:

``````Percentage Contribution =
Var A = COUNTA('Table'[Mode])
Var B = CALCULATE(COUNTA('Table'[Mode]),ALL('Table'))
Return
DIVIDE(A,B,0)``````

Output looks like this:

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

Super User

To get the % of Offline/Online use this

``% = DIVIDE(CALCULATE(COUNTROWS('DataTable'), 'DataTable'[Mode] = SELECTEDVALUE('DataTable'[Mode])), CALCULATE(COUNTROWS(ALL('DataTable'))))``

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

4 REPLIES 4
Super User

To get the % of Offline/Online use this

``% = DIVIDE(CALCULATE(COUNTROWS('DataTable'), 'DataTable'[Mode] = SELECTEDVALUE('DataTable'[Mode])), CALCULATE(COUNTROWS(ALL('DataTable'))))``

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

Super User

Hello @InsightSeeker ,

You have to create a measure for the same as below:

``````Percentage Contribution =
Var A = COUNTA('Table'[Mode])
Var B = CALCULATE(COUNTA('Table'[Mode]),ALL('Table'))
Return
DIVIDE(A,B,0)``````

Output looks like this:

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

Super User

Attached PBIX for reference.

Solution Supplier

Hi, you can create a measure to count rows for each mode.

Cnt = COUNTROWS(tablename)
Below is the output:

In the table, the mode column & the cnt measure used.

If this resolves your problem, then please mark it as solution, Thanks!

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors