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
viajero03082
Regular Visitor

Data segmentation (indicators)

Hello everyone
Q = How can I extract and name the following Alloc?
I need to know the number of allocations of these IDs, I extracted the first date from the date column.

 

1st = CALCULATE(FIRSTDATE('Tabla2 (2)'[Fecha de Alocación]), ALLEXCEPT('Tabla2 (2)','Tabla2 (2)'[No orden]))

 

After I got the first allocation with the name Alloc_1 and the other Alloc_n

 

Alloc_1 = if('Tabla2 (2)'[Fecha de Alocación]=BLANK(),"0_ALLOC",if('Tabla2 (2)'[Fecha de Alocación]='Tabla2 (2)'[1st],"Alloc_1","Alloc_n"))

viajero03082_0-1620880894010.png

 

I have to get the different alloc (alloc_2, alloc_3 ....) with the help of the ID and dates

viajero03082_1-1620880951596.png

That is, an ID of S1 will be Alloc_1, Alloc_2, Alloc_3 because it has 3 different dates ⬇️

viajero03082_2-1620880980189.png

As you will notice, there may be the same dates for an order and the dates are not always consecutive.

The final objective is to filter the report by this number of Alloc 2, 3, 4 with the help of how many dates the specific ID has.

Here is another example

viajero03082_3-1620881057307.png

We have separate dates and several IDs with dates in common and this should have Alloc_1, Alloc_2, Alloc_3, Alloc_4 since there are 4 dates where we try to attend that ID

 

I hope you can help me, I would appreciate it very much

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @viajero03082 

 

According to your description, I create a calculated colum to sort first, then create a measure or column to display results. Considering that you said there are duplicate date and id columns, but I don't know your data, so I sorted in pq and added the index column, so that there will be no less data when displayed in the visual.

Like this:

Column = RANKX(FILTER('table',[id]=EARLIER('table'[id])),'table'[date],,ASC,Dense)
Column 2 = CONCATENATE("Alloc_",'table'[Column])

v-janeyg-msft_0-1621237671181.png

If you still need help, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @viajero03082 

 

According to your description, I create a calculated colum to sort first, then create a measure or column to display results. Considering that you said there are duplicate date and id columns, but I don't know your data, so I sorted in pq and added the index column, so that there will be no less data when displayed in the visual.

Like this:

Column = RANKX(FILTER('table',[id]=EARLIER('table'[id])),'table'[date],,ASC,Dense)
Column 2 = CONCATENATE("Alloc_",'table'[Column])

v-janeyg-msft_0-1621237671181.png

If you still need help, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

 

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.