cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Dynamically group

Hello,

 

I have a table with name of report, date of creation and creator.

 

I would like to group creator. I need them to keep their name if they create 5%  or more of the total pool of report. If they creadted less than 5% of report, they have to by group in "Other"

 

I can group them manualy but I will have to check evrey month if they are ine the right category

 

Do you know a way to do so dynamically?

 

Thank in advance,

 

Emmanuelle

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

I would suggest that you create a table with only the creator names. This can be done by clicking Create Table and enter the following formula:

Creators = DISTINCT(Reports[Creator])

(assuming your table is called Reports.) Now establish a relationship between Creators and Reports on the Creator field.

 

Next step is to define a calculated new column called Group in the Creators table:

Group = 
VAR C = Creators[Creator] 
RETURN 
IF(CALCULATE(COUNTROWS(Reports),Reports[Creator] = C)/COUNTROWS(Reports) > 0.05, 
C,
"Other")

In your table visual you can now use Creators[Group] instead of Reports[Creator] and you should get the desired result.

 

View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

@Anonymous you can use a switch statement probably to derive it, however can you show me what your data looks like?  otherwise it will be hard to show you how to write it





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Hi Vanessa,

 

My data look like that

example.png

 

I have the creator name, the date of creation and the raport title

 

I would like to group C and D because they produce less then 5% of the report total

 

Hi @Anonymous,

I would suggest that you create a table with only the creator names. This can be done by clicking Create Table and enter the following formula:

Creators = DISTINCT(Reports[Creator])

(assuming your table is called Reports.) Now establish a relationship between Creators and Reports on the Creator field.

 

Next step is to define a calculated new column called Group in the Creators table:

Group = 
VAR C = Creators[Creator] 
RETURN 
IF(CALCULATE(COUNTROWS(Reports),Reports[Creator] = C)/COUNTROWS(Reports) > 0.05, 
C,
"Other")

In your table visual you can now use Creators[Group] instead of Reports[Creator] and you should get the desired result.

 

Anonymous
Not applicable

Perfect, thank you very much

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors