Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

New table with distinct ID + calculated columns on multiple conditions

Hello

 

I have a table with all my orders, linked to customers with a date and a channel

Here's a sample

CustomerIDOrderIDDateChannel
A1101/05/2023M
A1231/03/2022M
A1319/12/2022G
A2419/07/2023G
A2501/07/2020G
A3601/06/2023M
A4728/02/2021M
A4815/12/2020G
A4920/05/2022G
A41015/07/2021G
A41107/07/2023G
A41203/04/2021M

 

 

I'd like to create a new table that calculate number of orders per year per customer for a specific channel.

Let's take the example of channel G, I'd like to create the following table

CustomerIDNN+1N+2N+3N+4
A111   
A21   1
A41 12 

 

N = Number of orders in the last 365 days of the customer for the channel G

N+1 = Number of orders between 366 and 730 days compare to today of the customer for the channel G

 

I guess it is not that complicated as it seems something classical to do, but I don't find the right way to do it.

 

Thanks for your help

Maxime

1 REPLY 1
lbendlin
Super User
Super User

Not sure about your math.  I would recommend you use actual years rather than 365 days.

 

lbendlin_0-1693695373137.png

see attached

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors