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.
Hi,
I have the folowing table built:
The info comes from two different tables which are related by the SVID number with a many to many relationship.
The first seven columns comes from a flat file and the grey part comes from a data source. The column "Installed since close" calculates how mane units have been installed since the Close Month.
Solved! Go to Solution.
Hi @Anonymous
I created a simplified model and used a measure to get the number of months. Not sure where you want to show the result so I put it in a card visual.
Measure =
VAR __GA = MAX(TableA[GA])
VAR __t = FILTER(TableB,TableB[SVID]=MAX(TableA[SVID])&&TableB[Date]>=MAX(TableA[Sale Date]))
VAR __t2 = SUMMARIZE(__t,[SVID],[YearMonth],[StartOfMonth],"total",SUMX(FILTER(__t,[YearMonth]<=EARLIER([YearMonth])),[Number]))
VAR __endingMonth = MINX(FILTER(__t2,[total]>=__GA),[StartOfMonth])
VAR __closeMonth = MINX(__t,[StartOfMonth])
RETURN
DATEDIFF(__closeMonth,__endingMonth,MONTH)+1
Note that this measure may not be applicable to your model directly because our models are different. You can modify it accordingly to fit your model.
Let me know if you have any questions. If you couldn't get the expected result, share some sample data or sample pbix file after removing sensitive information.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
it worked perfectly thanks!!!
Thanks, is there a way to share the PBI files and excel tables apart from URL link?. Perhaps an email since I can´t get permissions to share any link.
Hi,
Thats right, so think Jan 2020 as the date the sale was done and Jan 2021 as the date where the units of that sale were completely installed (for exampe if we were selling solar panels). When the cumulative sum of installations reached 9000 we have completed that order. I would like to calculate the time period in months that took to reach those 9,000 orders. So Jan 2021 is the ending month as you said.
Hi @Anonymous
Sorry I'm not sure where I can know Jan 2021 is the month when 9000 were completed. Do we need to cumulate the values from Jan 2020 month by month (48+2786+139+...), until Jan 2021 when the cumulative value reached greater than 9000 the first time, so we think Jan 2021 is the ending month?
Regards,
Community Support Team _ Jing
Yes.
Do I need t provide something else?
Hi @Anonymous
I created a simplified model and used a measure to get the number of months. Not sure where you want to show the result so I put it in a card visual.
Measure =
VAR __GA = MAX(TableA[GA])
VAR __t = FILTER(TableB,TableB[SVID]=MAX(TableA[SVID])&&TableB[Date]>=MAX(TableA[Sale Date]))
VAR __t2 = SUMMARIZE(__t,[SVID],[YearMonth],[StartOfMonth],"total",SUMX(FILTER(__t,[YearMonth]<=EARLIER([YearMonth])),[Number]))
VAR __endingMonth = MINX(FILTER(__t2,[total]>=__GA),[StartOfMonth])
VAR __closeMonth = MINX(__t,[StartOfMonth])
RETURN
DATEDIFF(__closeMonth,__endingMonth,MONTH)+1
Note that this measure may not be applicable to your model directly because our models are different. You can modify it accordingly to fit your model.
Let me know if you have any questions. If you couldn't get the expected result, share some sample data or sample pbix file after removing sensitive information.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi there, interesting..
How would you do it if you were using events instead of months?
Example, i ave this
Adam is a new employee, and need to know how many more interactions he needs to reach the target score of 4?
I appreciate any suggestion, Thanks!
@Anonymous
You can add an index column to the table to mark the sequence of events. Filter the table to get rows whose accumulative score is greater than or equal to the target. Then get the minimum index from previous filtered result. That row is when he reaches the target.
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 |
---|---|
99 | |
97 | |
85 | |
70 | |
67 |
User | Count |
---|---|
116 | |
109 | |
94 | |
79 | |
72 |