Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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!
User | Count |
---|---|
66 | |
60 | |
47 | |
33 | |
32 |
User | Count |
---|---|
86 | |
75 | |
56 | |
50 | |
45 |