Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi, I'm very new to PowerBI and I'm having a problem calculating cycle time using transaction. This is super simple in Excel, the data includes mainly parts numbers (Container Names) going through different operations (several transaction can happen at each operation) and the transaction date is recorded. The data is coming from a SSMS server, when it comes in I sort the data by Container number and transaction date to makes this simpler, but one problem is once this data is pulled into table view it's no longer sorted.
My first approach was to create a calculated column to just bring in the transaction date of the most previous transaction, but this is proving to be difficult since the data is not coming in sorted. So if someone can help me figure out how to bring the data in sorted or a formula to get the last transation data I would be very grateful.
A sample of the data is shown below.
I tried this formula, but it doesn't work since the data isn't coming in sorted.
Solved! Go to Solution.
hi, @briantc
I'm happy to answer your questions. Sorry to hear that you are not sorting when importing data into power BI and it does not work when using calculated columns. First of all, if the connection method we choose is the Import connection, we can sort the data in Power Query.
My sample data is as follows:
In Power BI table view:
Using Power Query to sort data:
The result after sorting:
If the above sorting method helps you, that's great. If you have any questions, please let me know and I will do my best to solve your problem.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi, @briantc
I'm happy to answer your questions. Sorry to hear that you are not sorting when importing data into power BI and it does not work when using calculated columns. First of all, if the connection method we choose is the Import connection, we can sort the data in Power Query.
My sample data is as follows:
In Power BI table view:
Using Power Query to sort data:
The result after sorting:
If the above sorting method helps you, that's great. If you have any questions, please let me know and I will do my best to solve your problem.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Your calculated column formula seems correct. Just change the sign from <= to >=
@briantc Looks similar to MTBF essentially. If you can post sample data and expected results could confirm. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |