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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
binayjethwa
Helper V
Helper V

Calculate disntnct user domain

Hi , 

 

I have a requirement in power bi dax. 

 

I have 2 tables domain and learner activity. 

 

Domain table has below columns 

1. Domain 

2. Content id 

3. Program 

4. Content title 

 

Learner activity has below columns. 

1. User id 

2. Content id 

3. Start date 

4. End date. Etc 

 

Both tables are mapped with Content id as one to many. 

 

Program column has values respective to particular Domain and also no Program value. 

 

For example Domain column has agile. And Program column will have programs associated to agile. And sometimes Program column has "no Program " value also.  

 

Now i want to create a table which shows below 

 

1. Domain 

2. Users accessing only programs in that domain -[ if user access Domain A and all programs including no Program. Then I do not need him to be counted.  If he access all the programs in particular Domain except no Program in that domain then he is counted. ]

 

3. And overall users 

 

 Can some one help in this regard. 

 

 

 

 

 

1 ACCEPTED SOLUTION
ajaybabuinturi
Memorable Member
Memorable Member

Hi @binayjethwa,
Wanted to let you know that I have created a sample report for your requirement. You can refer Total Users, Users_Only_Program, Users_Only_Program2(to get grand total) measures.

Make sure chose Users_Only_Program or Users_Only_Program2 measure based on your business need.

Here is the .pbix file https://drive.google.com/file/d/1b-gXmTxH3b7Va5Xbu9H7bFgTi2_l_4_s/view?usp=sharing 

 

ajaybabuinturi_1-1751394234890.png

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

 

 

View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @binayjethwa 

Please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ajaybabuinturi
Memorable Member
Memorable Member

Hi @binayjethwa,
Wanted to let you know that I have created a sample report for your requirement. You can refer Total Users, Users_Only_Program, Users_Only_Program2(to get grand total) measures.

Make sure chose Users_Only_Program or Users_Only_Program2 measure based on your business need.

Here is the .pbix file https://drive.google.com/file/d/1b-gXmTxH3b7Va5Xbu9H7bFgTi2_l_4_s/view?usp=sharing 

 

ajaybabuinturi_1-1751394234890.png

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

 

 

Hi @ajaybabuinturi ,

 

I have few more conditions which need calculations as you shared earlier. atteching below screenshot for reference. Please let me know if we can achieve.

Thanks in advance.

binayjethwa_0-1757328191434.png

 

 

1User access domain and program with no program also should be counted , basically if in a domain he access only no programs then he is not counted.
2User access domain and program with no program should be counted , if he access only program completely or only no Program completely in a domain then not counted.
3

User access only no program then he is counted. If he access only programs or program and no program in a domain he is not counted

 

 

 

 

Thanks Ajay, This worked for me.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.