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 moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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 |
|---|---|
| 38 | |
| 38 | |
| 31 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 74 | |
| 61 | |
| 31 | |
| 31 | |
| 23 |