This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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% |
Solved! Go to Solution.
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
Regards
Phil
Proud to be a Super User!
Try This measure.
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
Regards
Phil
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 40 | |
| 39 | |
| 31 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 75 | |
| 61 | |
| 34 | |
| 30 | |
| 25 |