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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
InsightSeeker
Helper III
Helper III

Help on Measure

How can I calculate online / offline % from my data by using a measure?

 

Table 1

Name

Unique

Status

Apple

1

Offline

Apple

2

Online

Apple

3

Online

Grapes

4

Online

Grapes

5

Offline

Grapes

6

Offline

Carrot

7

Online

Carrot

8

Online

 

 

Table 2 (Result)

Name

Offline

Online

Grand Total

Apple

33%

67%

100%

Grapes

67%

33%

100%

Carrot

0%

100%

100%

Grand Total

38%

63%

100%

 

 

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

Hi @InsightSeeker 

 

Download PBIX file with these examples

 

Use these measures

 

 

Online = 

VAR _Rows = CALCULATE(COUNTROWS('DataTable'), FILTER(ALL('DataTable'), 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

VAR _OnlineRows = CALCULATE(COUNTROWS('DataTable'), FILTER((ALL('DataTable')), 'DataTable'[Status] = "Online" && 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

RETURN

DIVIDE(_OnlineRows, _Rows) + 0

 

 

 

Offline = 

VAR _Rows = CALCULATE(COUNTROWS('DataTable'), FILTER(ALL('DataTable'), 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

VAR _OfflineRows = CALCULATE(COUNTROWS('DataTable'), FILTER((ALL('DataTable')), 'DataTable'[Status] = "Offline" && 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

RETURN

DIVIDE(_OfflineRows, _Rows) + 0

 

 

onoff.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

KRISHP1234
Helper I
Helper I

KRISHP1234_0-1714469616475.png

Try This measure.

 

View solution in original post

2 REPLIES 2
KRISHP1234
Helper I
Helper I

KRISHP1234_0-1714469616475.png

Try This measure.

 

PhilipTreacy
Super User
Super User

Hi @InsightSeeker 

 

Download PBIX file with these examples

 

Use these measures

 

 

Online = 

VAR _Rows = CALCULATE(COUNTROWS('DataTable'), FILTER(ALL('DataTable'), 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

VAR _OnlineRows = CALCULATE(COUNTROWS('DataTable'), FILTER((ALL('DataTable')), 'DataTable'[Status] = "Online" && 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

RETURN

DIVIDE(_OnlineRows, _Rows) + 0

 

 

 

Offline = 

VAR _Rows = CALCULATE(COUNTROWS('DataTable'), FILTER(ALL('DataTable'), 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

VAR _OfflineRows = CALCULATE(COUNTROWS('DataTable'), FILTER((ALL('DataTable')), 'DataTable'[Status] = "Offline" && 'DataTable'[Name] = SELECTEDVALUE('DataTable'[Name])))

RETURN

DIVIDE(_OfflineRows, _Rows) + 0

 

 

onoff.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.