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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Current Flow / Inflow / Outflow

Hello Everyone, 

 

I would need your support for the calculations of the below metrics.

 

For every week (Monday to Sunday - column WeekNb), I need to determine:

- Current Flow: the number of records of the first day of the week - Monday; 

- Inflow: the number of new records that appeared during that week, starting Tuesday. We can have cases when a record was present the other day for the first time, dissapears today and appears again tomorrow. In this case, the Inflow for that record is 2. 

- Outflow: the number of records that dissapeared during that week. For this, we need to compare every record, day by day, next Monday included, to see if they are still present. We can have cases when a record dissapeared the other day, appears today and dissapears tomorrow. In this case, the Outflow for that record should be 2. 

 

Many thanks for your support!

 

1 ACCEPTED SOLUTION

Hi

I had trouble reconciling your requests with the sample data provided. Please check these discrepancies:

 

image.png

 

If you agree that these 2 "Inflows" aren't correct, given the current data, then the attached file should contain what you need.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous Does the above reply helps. if you need more help make me @

Appreciate your Kudos.

Hi @Anonymous  

I hope it goes without saying that if my solution above doesn't work for you, I'm happy to adjust to meet your needs.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

ImkeF
Super User
Super User

Anonymous
Not applicable

Hi @ImkeF , 

I am sorry, but I do not have the option to attach the excel file. 

 

For the Week no. 7, results for the below sample are:

CurrentFlow = 2
Inflow = 5
Outflow = 3

WeekNbRecordDay of the weekMentionsMentions
71001859MondayCurrentFlow 
71001522MondayCurrentFlow 
71001859TuesdayNo Inflow/No Outflow 
71001522TuesdayNo Inflow/No Outflow 
71001859WednesdayNo Inflow/No Outflow 
71001522WednesdayNo Inflow/No Outflow 
71132222WednesdayInflow (new record in that week,since yesterday) 
71001859ThursdayInflow (new record in that week,since yesterday)Outflow -one record missing - 1001522
71132222ThursdayNo Inflow/No Outflow 
71324433ThursdayInflow (new record in that week,since yesterday) 
71001859FridayNo Inflow/No Outflow 
71132222FridayNo Inflow/No Outflow 
71324433FridayNo Inflow/No Outflow 
71001859SaturdayNo Inflow/No Outflow 
71132222SaturdayNo Inflow/No Outflow 
71324433SaturdayNo Inflow/No Outflow 
71333224SaturdayInflow (new record in that week,since yesterday) 
71001859SundayNo Inflow/No Outflow 
71132222SundayNo Inflow/No Outflow 
71324433SundayNo Inflow/No Outflow 
71333224SundayNo Inflow/No Outflow 
71001859SundayInflow (new record in that week,since yesterday) 
81132222MondayNo Inflow/No OutflowOutflow -one record missing - 1333224
81324433MondayNo Inflow/No OutflowOutflow -one record missing - 1001859
81423224MondayNo Inflow/No Outflow. Even if it is a new record, due to the fact it is in the next week, we don't taking into consideration for the Outflow

 

Hi

I had trouble reconciling your requests with the sample data provided. Please check these discrepancies:

 

image.png

 

If you agree that these 2 "Inflows" aren't correct, given the current data, then the attached file should contain what you need.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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