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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tosi
New Member

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

 

1 ACCEPTED SOLUTION

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

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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())

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.