Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a DAX formula that is calculating the time difference between each consecutive row in a table visulaization. It works when I have only one process selected, but when I select multiple processes the Time Diff measure is incorrect. See images below.
DAX formula:
One selection
Two selection
Solved! Go to Solution.
It looks like it is correctly calculating the difference between rows (regardless of the Process). If you'd like to keep the Process in context, you need to add VALUES('Main Table'[Process]) to your Calculate().
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
I would start by dropping your ALLSELECTED and not using CALCULATE.
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...
I have a great version of that in my book, DAX Cookbook. If you can post sample data, I'll try to adapt it for your situation. 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.
@Anonymous Seems like the issue is that when you are getting the MAX, it is pulling for Line 11 or basically the wrong thing and this is likely because of your ALLSELECTED which I try not to use if at all possible and not sure why you need it. I would start by dropping it.
This post may help. 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/339586
I have a great version of that in my book, DAX Cookbook.
Also, if you can paste some of your source data or sample source data I can probably adapt the formula from my book for you. 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.
It looks like it is correctly calculating the difference between rows (regardless of the Process). If you'd like to keep the Process in context, you need to add VALUES('Main Table'[Process]) to your Calculate().
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
That works! Thank you
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |