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

Index Column Groupby() and currentgroup()

Hi all, i have a table with the columns ID and Category.  The goal is to create a new table that lists the IDs, and an index of the number of categorys an ID had in its lifetime.

 

Example:

 

Data Table

ID / Category 

00001 / SWF Info

00001 / Response FOMA

00001 / Creditreform

00001 / Legal IKU

00001 / Bankcrupcy

 

Desiered Result should be:

ID / Index

00001 / 5

 

 

I tried this

Samuel7265_0-1692018840021.png

 

 

1 ACCEPTED SOLUTION

Hi @Samuel7265 I am not familiar with your model, if it is simply like your example with 2 columns, possible solution could be  measeure 

Index Test = COUNTROWS('Sheet1 (2)')

Replace Sheet1 (2) with your table name. Hope this help

some_bih_0-1692100331806.png

 





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

Proud to be a Super User!






View solution in original post

4 REPLIES 4
some_bih
Super User
Super User

Hi @Samuel7265 It seems you need to  use DISTINCTCOUNT function over your column Category?

Check link below. 

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

https://learn.microsoft.com/en-us/dax/distinctcount-function-dax?WT.mc_id=DP-MVP-4025372 





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

Proud to be a Super User!






Thanks for your answer. DISTINCTCOUNT cant be used in the context of GROUPBY().

 

Hi @Samuel7265 I am not familiar with your model, if it is simply like your example with 2 columns, possible solution could be  measeure 

Index Test = COUNTROWS('Sheet1 (2)')

Replace Sheet1 (2) with your table name. Hope this help

some_bih_0-1692100331806.png

 





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

Proud to be a Super User!






Hi @Samuel7265 If this is solution, please accept it so other member of community could use it. Thank you





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

Proud to be a Super User!






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.