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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.