cancel
Showing results for
Did you mean:

## Organize Products by date of registration and cancellation

Hello!

I have a report in which you need to perform the following calculations for each Product:

• Product registration date (With the most recent date per Product)
• Product Cancellation Date (Most Recent Date by Product)

With the following structure:

And that in the end you can organize for each product the High Date, Low Date (if there is no product cancellation date, it will be blank) with the following structure:

Thanks a lot!

1 ACCEPTED SOLUTION
Community Support

Here are the steps you can follow：

1. Create calculated column.

``````maxgroup_date =
var _max=MAXX(FILTER(ALL('Table'),
'Table'[Product]=EARLIER('Table'[Product])&&'Table'[TipoDeSolicitud]=EARLIER('Table'[TipoDeSolicitud])),[FechaSolicitud])
return
IF(
'Table'[TipoDeSolicitud]="Alta",_max)``````
``````maxdate =
var _maxdate = MAXX(ALL('Table')
,[FechaSolicitud])
return
IF(
'Table'[TipoDeSolicitud]="Baja",_maxdate)``````

2. Create calculated table.

``````Table 2 =
SUMMARIZE(
'Table',
'Table'[Product],
"FechaAlta",
MAXX(FILTER(ALL('Table'),[Product]=EARLIER('Table'[Product])),[maxgroup_date]),
"FechaBaja",
MAXX(FILTER(ALL('Table'),[Product]=EARLIER('Table'[Product])),[maxdate])
)``````

3. Result:

Best Regards,

Liu Yang

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

Community Support

Here are the steps you can follow：

1. Create calculated column.

``````maxgroup_date =
var _max=MAXX(FILTER(ALL('Table'),
'Table'[Product]=EARLIER('Table'[Product])&&'Table'[TipoDeSolicitud]=EARLIER('Table'[TipoDeSolicitud])),[FechaSolicitud])
return
IF(
'Table'[TipoDeSolicitud]="Alta",_max)``````
``````maxdate =
var _maxdate = MAXX(ALL('Table')
,[FechaSolicitud])
return
IF(
'Table'[TipoDeSolicitud]="Baja",_maxdate)``````

2. Create calculated table.

``````Table 2 =
SUMMARIZE(
'Table',
'Table'[Product],
"FechaAlta",
MAXX(FILTER(ALL('Table'),[Product]=EARLIER('Table'[Product])),[maxgroup_date]),
"FechaBaja",
MAXX(FILTER(ALL('Table'),[Product]=EARLIER('Table'[Product])),[maxdate])
)``````

3. Result:

Best Regards,

Liu Yang

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

Announcements

#### The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

#### Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

#### Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors