Forum Discussion
Measure for counting licences/licence type
- 9 years ago
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())
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
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())