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
Ade1991
Helper I
Helper I

Transform each category of line as table

Hi,

 

I have the following table, with three columns :

 

Structuration.PNG

 

I would like to transform it to make each category of the first table as an independant entity (as a table ?).

 

My target is to be able to manipulate each of the categories independantly (currently, i'm using a filter in each of my visual, seems bad...).

 

Any advice about the best structuration is welcome.

 

Thanks

7 REPLIES 7
VasTg
Memorable Member
Memorable Member

@Ade1991 

 

You have to do it manually for each category if you would like to split.

 

Query Editor

https://community.powerbi.com/t5/Desktop/Splitting-a-table-into-two-based-on-column-value/td-p/11501...

 

DAX

https://community.powerbi.com/t5/Desktop/Split-Query-for-Tables/td-p/471686

 

I would still go with visual filter(or page filter if possible) if the categories are in double digits or more..

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn

At the end, y target is to be able, for example, to compare two of type of line in the time. I have the date so it will be ok for my axis.

However, If I use filter, I won't be able to distinguish between them

 

I tried the first solution with Power Query, but I can't seriously to do it (I have so many lines).

Hi @Ade1991 ,

 

You'd better create new tables by using dax expression such as below:

 

Table 3 = FILTER('Table','Table'[Date]=DATE(2016,8,1))

 

Then you will see:

Annotation 2020-02-14 144718.png

 


 
Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

Thanks for the answer

 

No way to make a loop for each unique value of the column ?

Hi,

 

Did you try to use CALCULATETABLE function ?

I use a measure like the one below to make a table with customer from the past 6 months :

TabClient 6 derniers mois = CALCULATETABLE(Clients;DATESINPERIOD(MonCalendrier[Date];TODAY();-6;MONTH))
 
Olivier 

Thanks 

However, in this kind of solution, I need to fill by hand each distinct name of lines.

 

No way to make a loop ?

Hi,

 

Oui en effet comme avec la solution en DAX...

 

Une autre piste pourrait être de créer une table de valeurs uniques avec Power Query :

= List.Distinct(Projet[Categorie])

Et ensuite de mettre en relations cette table de valeurs uniques avec votre autre table...

Peut-être cela peut déjà résoudre certaines problématiques...

 

Olivier

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.