cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Current Flow / Inflow / 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

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: Current Flow / Inflow / Outflow

Hi @Melisa123  

please paste sample data of the input and desired output. Thanks.

These links might help as well:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

and

https://social.technet.microsoft.com/wiki/contents/articles/28212.how-to-ask-a-power-bipower-querypo...

 

 

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

Highlighted
Helper II
Helper II

Re: Current Flow / Inflow / Outflow

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

 

Highlighted
Super User III
Super User III

Re: Current Flow / Inflow / 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

View solution in original post

Highlighted
Super User IV
Super User IV

Re: Current Flow / Inflow / Outflow

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

Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Super User III
Super User III

Re: Current Flow / Inflow / Outflow

Hi @Melisa123  

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors