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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JMAL79
New Member

Create Customers and Date Table

Hi Experts, 

 

I am new to PowerBI and I have an excel file as my source and raw data has a table as follows (customer, issue key, date opened, date closed). Is there a way to create a customer table looking like the picture below? Would need to calculate Inflow/Outflow by customer by Month. 

 

JMAL79_0-1649180749423.png

 

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @JMAL79 ,

I created some data:

vyangliumsft_0-1649399332682.png

Here are the steps you can follow:

1. Create calculated table.

Table 2 = DISTINCT('Table'[Create date])

vyangliumsft_1-1649399332683.png

2. Create measure.

Inflow =
    COUNTX(FILTER(ALL('Table'),'Table'[Create date]<=MAX('Table 2'[month])&&'Table'[Close date]>MAX('Table 2'[month])),[Account])
Outflow =
var _customer1=
COUNTX(FILTER(ALL('Table'),'Table'[Close date]<=MAX('Table 2'[month])),[Account])
var _customer2=
COUNTX(FILTER(ALL('Table'),'Table'[Close date]<=MAX('Table 2'[month])-1),[Account])
return
_customer1 - _customer2

3. Result:

vyangliumsft_2-1649399332684.png

Please click here for the pbix file

 

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

tried it and it isnt grouped by Account but by Date only.. Expected output should be "by account by date per month"

JMAL79
New Member

Hi @PijushRoy thanks for your response. Raw Data looks something like this. Would want to get a table summarizing inflow and outflow "per customer per month in year". Somwhat like when you pivot table in excel.

Case NumberCustomer NameDate OpenedDate Closed
1Customer 110/22/201811/12/2018
2Customer 16/6/20186/27/2018
3Customer 211/2/201811/23/2018
4Customer 211/5/201811/26/2018
5Customer 211/5/201811/26/2018
6Customer 36/4/20186/25/2018
7Customer 311/6/201811/27/2018
8Customer 311/6/201811/27/2018
9Customer 311/8/201811/29/2018

 

PijushRoy
Super User
Super User

Hi @JMAL79 

Please share sample data (not sensetive data)




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.