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.
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!
Solved! Go to Solution.
Hi
I had trouble reconciling your requests with the sample data provided. Please check these discrepancies:
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
@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
Hi @Anonymous
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
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
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
WeekNb | Record | Day of the week | Mentions | Mentions |
7 | 1001859 | Monday | CurrentFlow | |
7 | 1001522 | Monday | CurrentFlow | |
7 | 1001859 | Tuesday | No Inflow/No Outflow | |
7 | 1001522 | Tuesday | No Inflow/No Outflow | |
7 | 1001859 | Wednesday | No Inflow/No Outflow | |
7 | 1001522 | Wednesday | No Inflow/No Outflow | |
7 | 1132222 | Wednesday | Inflow (new record in that week,since yesterday) | |
7 | 1001859 | Thursday | Inflow (new record in that week,since yesterday) | Outflow -one record missing - 1001522 |
7 | 1132222 | Thursday | No Inflow/No Outflow | |
7 | 1324433 | Thursday | Inflow (new record in that week,since yesterday) | |
7 | 1001859 | Friday | No Inflow/No Outflow | |
7 | 1132222 | Friday | No Inflow/No Outflow | |
7 | 1324433 | Friday | No Inflow/No Outflow | |
7 | 1001859 | Saturday | No Inflow/No Outflow | |
7 | 1132222 | Saturday | No Inflow/No Outflow | |
7 | 1324433 | Saturday | No Inflow/No Outflow | |
7 | 1333224 | Saturday | Inflow (new record in that week,since yesterday) | |
7 | 1001859 | Sunday | No Inflow/No Outflow | |
7 | 1132222 | Sunday | No Inflow/No Outflow | |
7 | 1324433 | Sunday | No Inflow/No Outflow | |
7 | 1333224 | Sunday | No Inflow/No Outflow | |
7 | 1001859 | Sunday | Inflow (new record in that week,since yesterday) | |
8 | 1132222 | Monday | No Inflow/No Outflow | Outflow -one record missing - 1333224 |
8 | 1324433 | Monday | No Inflow/No Outflow | Outflow -one record missing - 1001859 |
8 | 1423224 | Monday | No 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:
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |