cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

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:

LoloGox_0-1655805651125.png

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:

LoloGox_1-1655805651126.png

Thanks a lot!

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

Hi  @Syndicate_Admin ,

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)

vyangliumsft_0-1656033194113.png

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:

vyangliumsft_1-1656033194116.png

 

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Syndicate_Admin ,

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)

vyangliumsft_0-1656033194113.png

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:

vyangliumsft_1-1656033194116.png

 

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

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

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

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

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

Power Platform Conf 2022 768x460.jpg

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