Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I am looking for the correct dax syntax to get all users in my table who have the licenceType = "demo" && userRole= "customer" and at the same time do not have the licenceType = "full" && userRole= "customer". As a result I want to get a distinctcount of the users who only have the licenceType = "demo" and not licenceType = "full". I'm looking forward to your help...
| userId | userRole | licenceType | date | action
| a | customer | demo | 21.12.2019 | action
| a | customer | full | 22.12.2019 | action
| b | customer | demo | 22.12.2019 | action
| c | customer | demo | 22.12.2019 | action
| c | customer | full | 29.12.2019 | action
The result based on this sample should be 1.
Solved! Go to Solution.
Here is a rough version. May need some context refinement.
OnlyDemo =
var fulls = SELECTCOLUMNS(CALCULATETABLE('Table','Table'[licenceType ]="full"),"id",'Table'[userId ])
var demos = SELECTCOLUMNS(CALCULATETABLE('Table','Table'[licenceType ]="demo"),"id",'Table'[userId ])
return countrows(except(demos,fulls))
Here is a rough version. May need some context refinement.
OnlyDemo =
var fulls = SELECTCOLUMNS(CALCULATETABLE('Table','Table'[licenceType ]="full"),"id",'Table'[userId ])
var demos = SELECTCOLUMNS(CALCULATETABLE('Table','Table'[licenceType ]="demo"),"id",'Table'[userId ])
return countrows(except(demos,fulls))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |