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
EnriqueHCancino
Frequent Visitor

Count relationship rows disabled

I appreciate your help

I have 3 tables:
Table A tasks
Table B Records

Tabala C Prospects

What I need is a calculated column that tells us how many tasks each client has been given, a column in Registers and another in the prospects column.

 

I have an active relation between table A and C and a deactivated relation between A and B

Sin título.png

 

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hi @EnriqueHCancino ,

 

There are a number of ways to do this.  The easiest way would be to just use that field in a card as Count (Distinct) on that specfiic field.

 

If you want to do it in the Power Query Editor you could put a custom column that counts tasks by client and then you could use the visual to sum that number up for each combination.  Or, you could create an entirely separate query using the Group BY function to get client and task - that will give you the number directly.  (But, this might not be very efficient.)

 

If you want to use DAX and create a column in the visual only something like this will probably work.  You should look up the DAX as this is not the DAX forum.  But, something like this might work:

Measure = CALCULATE(COUNT(table[Tasks]), GROUPBY(Table, Table[Customer]))

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

3 REPLIES 3
edhans
Super User
Super User

Can you provide some data @EnriqueHCancino - your screen is too small to see and I'd have to key it in anyway. I'd rather copy and paste.

I think the goal here should be to either do this in Power Query with a custom column, or in DAX with a measure. In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
collinq
Super User
Super User

Hi @EnriqueHCancino ,

 

There are a number of ways to do this.  The easiest way would be to just use that field in a card as Count (Distinct) on that specfiic field.

 

If you want to do it in the Power Query Editor you could put a custom column that counts tasks by client and then you could use the visual to sum that number up for each combination.  Or, you could create an entirely separate query using the Group BY function to get client and task - that will give you the number directly.  (But, this might not be very efficient.)

 

If you want to use DAX and create a column in the visual only something like this will probably work.  You should look up the DAX as this is not the DAX forum.  But, something like this might work:

Measure = CALCULATE(COUNT(table[Tasks]), GROUPBY(Table, Table[Customer]))

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




 

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.