Forum Discussion
Array formula
Hello,
By using array formula ( {=B2-MIN(IF($A$2=$A$2:$A$51;$B$2:$B$51))}, where column A is ID and column B is date/time ), in excel I could plot values under a period of time, say 0 to 6 min instead of date on the x-axis. Can anyone help me write this Power BI? Thanks in advance.
Hi kranthi82 ,
Try to use the following calculated column:
Log_Dax_Based = 'Table'[LogTime] - CALCULATE ( MIN ( 'Table'[LogTime] ); ALLEXCEPT ( 'Table'; 'Table'[ID] ) )You can also do it based on a query editor, check the PBIX file with both options.
I also got a Logs Excel column so you can compared it with the results.
Regards,
MFelix
8 Replies
- AnonymousNot applicable
DAX operates on the concept of columns, so what was your array will be column. Now the trick is to figure out how to change/modify what is in that table.
If you post some sample data and your expected outcome I can help you out with this specific example, but I'd recommend taking a look at these links from microsoft on dax
https://docs.microsoft.com/en-us/dax/data-analysis-expressions-dax-reference
- kranthi82Helper I
Anonymous Thank you so much for your advice. I indeed learn everyday DAX and try to solve myself in the first place.
Here is some sample data and I hope you can help me.
The Log column data has been calculated from Excel so the DAX or Column expression should give the data as in the Log column and if I plot it then it should look as follows.
- daxCommunity Support
Hi kranthi82,
Below is my data sample
id date amount log
1 2019/8/1 10:50:54 1 00:00:00 1 2019/8/1 10:51:25 2 00:00:30 1 2019/8/1 10:51:54 3 00:01:00 1 2019/8/1 10:52:25 4 00:01:30 1 2019/8/1 10:52:54 4 00:02:00 1 2019/8/1 10:53:25 4 00:02:30 1 2019/8/1 10:53:54 4 00:03:00 1 2019/8/1 10:54:25 3 00:03:30 1 2019/8/1 10:54:54 2 00:04:00 1 2019/8/1 10:55:25 1 00:04:30 2 2019/8/1 11:25:20 1 00:00:00 2 2019/8/1 11:25:50 2 00:00:30 2 2019/8/1 11:26:20 3 00:01:00 2 2019/8/1 11:26:50 4 00:01:30 2 2019/8/1 11:27:20 4 00:02:00 2 2019/8/1 11:27:50 4 00:02:30 2 2019/8/1 11:28:20 4 00:03:00 2 2019/8/1 11:28:50 3 00:03:30 2 2019/8/1 11:29:20 2 00:04:00 2 2019/8/1 11:29:50 1 00:04:30 3 2019/8/1 12:23:33 1 00:00:00 3 2019/8/1 12:24:03 2 00:00:30 3 2019/8/1 12:24:33 3 00:01:00 3 2019/8/1 12:25:03 4 00:01:30 3 2019/8/1 12:25:33 4 00:02:00 3 2019/8/1 12:26:03 4 00:02:30 3 2019/8/1 12:26:33 4 00:03:00 3 2019/8/1 12:27:03 3 00:03:30 3 2019/8/1 12:27:33 2 00:04:00 3 2019/8/1 12:28:03 1 00:04:30
If you want to get result like belowYou could try to create measure like below
Measure 6 = AVERAGE('Table (2)'[amount])Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.