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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FlyingBlind
New Member

Trying to calculate logins as % of total

Hi All, 

 

Hopefully I have put this in the right place. 

 

I am trying to make a cluster chart with the following information: Y axis # number users, X axis location.

  • total users
  • total users who have logged in since April 1st
  • logged in users as a percentage

    Creating the first two using filters is relatively easy however I cannot for the life of me get a measure using DAX that shows me #of users logged in after 1st of April so I can create the % measure. Example dataset below with irrelevant columns removed and anonymised. 

FlyingBlind_0-1686636967176.png

 

 

I've tried the following to get a filtered measure on the last login date that I found online but I'm just getting the total count.. The date filter isn't being applied. 

 

COUNT_Logins_After_May =
CALCULATE([COUNT_Logins],
FILTER(
    Users,
    Users[Last Login].[Date] >= 01/05/23
))

 

Any ideas? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @FlyingBlind,

You can try to use the following measure formula if it stable for your requirement: (get the last date based on table records as condition to calculate the percent of total)

COUNT_Logins_After_May =
VAR _lastdate =
    CALCULATE (
        MAX ( Users[Last Login] ),
        FILTER ( ALLSELECTED ( Users ), [Last Login] <> BLANK () )
    )
RETURN
    DIVIDE (
        CALCULATE ( [COUNT_Logins], Users[Last Login] >= _lastdate ),
        [COUNT_Logins]
    )

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @FlyingBlind,

You can try to use the following measure formula if it stable for your requirement: (get the last date based on table records as condition to calculate the percent of total)

COUNT_Logins_After_May =
VAR _lastdate =
    CALCULATE (
        MAX ( Users[Last Login] ),
        FILTER ( ALLSELECTED ( Users ), [Last Login] <> BLANK () )
    )
RETURN
    DIVIDE (
        CALCULATE ( [COUNT_Logins], Users[Last Login] >= _lastdate ),
        [COUNT_Logins]
    )

Regards,

Xiaoxin Sheng

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.