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
Anonymous
Not applicable

countdistinct data grouped by hours from many tables

Hallo I've got 5 tables(named: carico, scarico, abbassamento, ricevimento) with these field:

- users

- hours: the hours field are numbers(1,2,3,4,5,6, etc)

 

I've got also a tables where I neet to group for each hour the count of the users, here an example of the output I would to have:

oraritbl1tbl2tbl3tbl4
0    
1    
2 22 
33  1
4 35 
5 156
610 5 
712 5 
812 5 
9128  
10128  
111283 
121283 
1398  
14128  
151283 
16128  
171086 
18 8  
19 8  
20 8 7
21   7
22   7
23   7
24    

 

what is the DAX formulas to catch it?

 

thanks in advance for your help

Andrea

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create four measures like this:

 

table1 = CALCULATE(DISTINCTCOUNT(Table1[user]),FILTER(Table1,Table1[hours]=MAX('Table'[orari])))

 

test_countdistinct data grouped by hours from many tables.PNG

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create four measures like this:

 

table1 = CALCULATE(DISTINCTCOUNT(Table1[user]),FILTER(Table1,Table1[hours]=MAX('Table'[orari])))

 

test_countdistinct data grouped by hours from many tables.PNG

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@Anonymous Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Fowmy
Super User
Super User

@Anonymous 

You need to first create a singles table combining all 5 tables as they all consist of the same information. Then you will be able to summarize the way you.

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.