Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone 🙂
Q How can I extract and name the next Alloc?
I need to know the number of crazy ones in 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]))
Then I got the first date 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"))
I have to get the different alloc (alloc_2, alloc_3 ....) with the help of id and dates
That is, an S1 ID will be Alloc_1, Alloc_2, Alloc_3 because it has 3 different dates
As you'll notice there may be the same dates for an order and the dates aren't always consecutive
The ultimate goal is to filter the report by this alloc number 2, 3, 4 with the help of how many dates the specific ID has
Here's another example
We have separate dates and multiple IDs with dates in common and this should have Alloc_1, Alloc_2, Alloc_3, Alloc_4 since it is 4 dates where we try to address that ID
I hope you can help me, I would thank you very much
Solved! Go to Solution.
Hi @viajero03082 ,
You can do this on the query editor by doing the following steps:
Table.AddIndexColumn ([Count], "Index",1)
"Alloc_" & Number.ToText ([Index])
If you want to do it in dax use the following code:
Alloc =
VAR temp_table =
FILTER (
ALL ( 'Table (2)'[show_id], 'Table (2)'[date] ),
'Table (2)'[show_id] = EARLIER ( 'Table (2)'[show_id] )
&& 'Table (2)'[date] <= EARLIER ( 'Table (2)'[date] )
)
RETURN
"Alloc_" & COUNTROWS ( temp_table )
See PBIX file with two versions attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @viajero03082 ,
You can do this on the query editor by doing the following steps:
Table.AddIndexColumn ([Count], "Index",1)
"Alloc_" & Number.ToText ([Index])
If you want to do it in dax use the following code:
Alloc =
VAR temp_table =
FILTER (
ALL ( 'Table (2)'[show_id], 'Table (2)'[date] ),
'Table (2)'[show_id] = EARLIER ( 'Table (2)'[show_id] )
&& 'Table (2)'[date] <= EARLIER ( 'Table (2)'[date] )
)
RETURN
"Alloc_" & COUNTROWS ( temp_table )
See PBIX file with two versions attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
113 | |
81 | |
45 | |
42 | |
27 |
User | Count |
---|---|
182 | |
83 | |
70 | |
48 | |
45 |