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 September 15. Request your voucher.

Reply
sharpedogs
Advocate II
Advocate II

Counting how many people used an application?

Hi, 

I have a list of user logins and the applications they log into. I want to write a DAX that calculates the applicaitons that have had less than 5 User logins, 5 to 10 and 10 plus. From a use case, it's essentially telling me Applications that are rearely used. The data set looks like such.  

 

The DAX sould show that

Office has only 1 user, even through Chad logged in 3 times

Adobe has 3 users

Citris has 1 user

 

In my practive i thought it would be something like

Measure =  calculate( distinctcount [table name], Application name)    ----- essentially counitng unique names for each application.. But i am overlooking something?

 

APPLICATIONUSERDATE
OFFICECHADJAN 1
ADOBECHADJAN3
OFFICE CHADFEB 9
OFFICE CHADMAR 8
ADOBE MATMAR 9
ADOBEMATMAR 15
ADOBEJAMESMAR 6
CITRIXJAMESMAR 6

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Whenever you are declaring variable in dax you have to type keyword "return" and after return whatever is there is the output of your statement.

Measure=
Var a=Calculate(distinctcount(table[user]),allexcept(table,table[application])

Return
If(a<=5,a,blank())

Incase the other measure is working incase then just change var a= that summerize one statement.


Thanks
Pravin

If it resolves your problem mark it as a solution and give Kudos.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Try this:

Measure = 
VAR v_table = SUMMARIZE( Table2, Table2[APPLICATION], Table2[USER])
RETURN
COUNTX( v_table, [APPLICATION])

Hi, 

i'm rather new so some of the syntex throws me off. From DAX bar when i go to put VAR... i get 2 options VAR.P and VAR.S, i'm not sure which you are referring to? As well what does "RETURN" mean? I'm new to DAX so this is a leanring experience for me as well. 

 

Measure = 
VAR v_table = SUMMARIZE( Table2, Table2[APPLICATION], Table2[USER])
RETURN
COUNTX( v_table, [APPLICATION])

 

Anonymous
Not applicable

Whenever you are declaring variable in dax you have to type keyword "return" and after return whatever is there is the output of your statement.

Measure=
Var a=Calculate(distinctcount(table[user]),allexcept(table,table[application])

Return
If(a<=5,a,blank())

Incase the other measure is working incase then just change var a= that summerize one statement.


Thanks
Pravin

If it resolves your problem mark it as a solution and give Kudos.
Anonymous
Not applicable

Try this

Calculate(distinctcount(table[user]),allexcept(table,table[application])

Thanks,
Pravin


If it resolves your problem mark it as a solution and give Kudos.

Hi,

This essentially ansewered the question i posted, but my mistake for not being clear. I've got this far which is essentially showing the unique users per applicaiton. The second part of the ask (i forgot to post), is now I wnat to have this DAX only show applications that have 5 of fewers users.

 

i thought i could just add ( <= 5) at the end of DAX and it woudl only show me apps with 5 or fewer unique users. But it's a True/False statement. how do i turn that back into a number? 

 

 

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.