Forum Discussion

chetanpatel14's avatar
chetanpatel14
New Member
1 year ago
Solved

Summarize the Measure output

In Power Bi, I have a 'public dailyusagereport' with 2 columns called "Name" and "LastLoginDate". My input table as data from Aug 2023 to 6th Nov2024 1.I have provided the date range in the slicer o...
  • SamWiseOwl's avatar
    SamWiseOwl
    1 year ago
    It is creating a measure that will use your existing measure on your table 'public dailyusagereport' to work out how many logins each person has and then group them.
     
    Replace LoginTable with the name of your table like so:
     
    Count Logins=
    var logintable = --Create a virtual version of your table, calc for each person their login no
    SUMMARIZE('public dailyusagereport','public dailyusagereport'[Name]"Count login", [LoginCountPerUserMeasure] )

    var currNum = SelectedValue(LoginCount[Value]) --capture the current rows login count

    var final =
    COUNTROWS(FILTER(logintable[Count login] = currNum)) --Filter the login to only people with that no of logins
    RETURN final
     
    The -- are just comments to explain what the code is doing. You can delete these 🙂