Reply
Frequent Visitor
Posts: 2
Registered: ‎06-27-2017
Accepted Solution

Measure for counting licences/licence type

Hi, we have two options how to licence Adobe CC - either get a full suite (if someone is using 3 or more Adobe apps), or licence them individually per app (if using just one or two). I get data from SCCM in this simplified format:

Timekey (Month) -- Username -- Application -- UsageTime; E.g. 201706 -- tom -- Premiere -- 20 (hours).

 

I would like to display total number of users for selected month(s) (including per-app details) and the number of licences we need. E.g. we had 10 users, 6 of which will need full suite and plus we have to licence additional 7 app for remaining 4 users (as they use 2, 2, 2, 1 apps each in the given time period).

 

I kind of succeded with creating a summary table (per username and creating some metrics on that), but that only works if I don't filter (months or user types) (e.g. for months all historical data is always considered for the given users, ignoring displayed data). E.g. user called Mike used Photoshop in January and Premiere in February. If I don't filter by time, it should say 2 apps, if I filter one month, the measure should show only 1 single licence/app.

 

What I tried (and doesn't work?):

If I create summary by user AND time, then I get a table with a many to many relationship. If I create another summary, it doesn't talk to the other table or I get a loop. I believe the solution should be in writing a measure directly in the data table instead of creating temporary summary tables and creating relationships. But how?

 

This is how the report looks like (user count is incorrect, total full suites is correct 9, plus additional 11 licences; but I am not time-filtering)

r works.PNG

 

With time filter, I get correct user count, but licence types are broken. 

r broken.PNG

 

My relationships. 

schema.PNG

 

Measure MeterData[User Count] = DISTINCTCOUNT(MeterData[UserName]) . Why does it not show usercount correctly?

Meausre AppSummary[Total FS] =  CALCULATE(SUM(AppSummary[FullSuites]))

Column AppSummary[FullSuites] = IF([Apps]>2, 1, BLANK())   //apps is a result of the SUMMARY over usagetime

 

Am I missing something obvious? Is there a good source that would explain what I am doing wrong?

Thank you

 


Accepted Solutions
Highlighted
Frequent Visitor
Posts: 2
Registered: ‎06-27-2017

Re: Measure for counting licences/licence type

I appreciate your reply! However, I just managed to solve it myself. An article at SQLBI pointed me to an idea, that it is actually an SQL statement with "having" condition (and they had an example how to write such a DAX query). 

And the solution for licenses was in SUMMARY, but without actually creating another table/relationship.

Total full suites = COUNTROWS( FILTER( SUMMARIZE(MeterData, 'acp net'[username], "Apps", [AppCount]), [Apps] > 2))

Total SALs = SUMX( FILTER( SUMMARIZE(MeterData, 'acp net'[username], "AppsX", [AppCount]), [AppsX] < 3), [AppsX])

 

The User count problem was my mistake, as I didn't use a filter.

User count = CALCULATE(DISTINCTCOUNT(MeterData[UserName]), MeterData[IsUsageOverThreshold] = TRUE())

 

 

View solution in original post


All Replies
Community Support Team
Posts: 7,441
Registered: ‎08-14-2016

Re: Measure for counting licences/licence type

Hi @tosi,

 

If you can please share a sample file to test, it is hard to reproduce/troubleshooting the issue without sample data.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
Highlighted
Frequent Visitor
Posts: 2
Registered: ‎06-27-2017

Re: Measure for counting licences/licence type

I appreciate your reply! However, I just managed to solve it myself. An article at SQLBI pointed me to an idea, that it is actually an SQL statement with "having" condition (and they had an example how to write such a DAX query). 

And the solution for licenses was in SUMMARY, but without actually creating another table/relationship.

Total full suites = COUNTROWS( FILTER( SUMMARIZE(MeterData, 'acp net'[username], "Apps", [AppCount]), [Apps] > 2))

Total SALs = SUMX( FILTER( SUMMARIZE(MeterData, 'acp net'[username], "AppsX", [AppCount]), [AppsX] < 3), [AppsX])

 

The User count problem was my mistake, as I didn't use a filter.

User count = CALCULATE(DISTINCTCOUNT(MeterData[UserName]), MeterData[IsUsageOverThreshold] = TRUE())