array
2 TopicsDAX equivalent to excel Array
Hi, I have an excel array formula that I need help in writing the DAX eqivalent. Columns Station ID Start Time End Time My formula captures the start time of next start per Station ID. Next Start Time - Excel Array Formula {=MIN(IF(A3:A$4983=A2,IF(B3:B$4983>C2,B3:B$4983)))} I would like to have this calculated in DAX, but cannot figure out equivalent. Any help would be greatly appreciated. /tks Station ID Start Time End Time Usage (kWh) Peak kW SiteID ChgId Duration MicroSess NextStartTime 100001-02 2021-09-01 10:37:35 2021-09-01 10:59:43 27 207 100001 2 0:22:08 13:46:23 100001-02 2021-09-01 13:46:23 2021-09-01 14:31:08 17 207 100001 2 0:44:45 17:35:09 100001-02 2021-09-01 17:35:09 2021-09-01 18:14:22 53 207 100001 2 0:39:13 15:47:56 100001-01 2021-09-02 12:04:22 2021-09-02 12:21:19 4 65 100001 1 0:16:57 14:52:53 100001-02 2021-09-02 15:47:56 2021-09-02 16:48:24 36 60 100001 2 1:00:28 11:11:17 100001-02 2021-09-03 11:11:17 2021-09-03 11:30:51 6 60 100001 2 0:19:34 16:09:11 100001-01 2021-09-03 14:52:53 2021-09-03 15:08:59 4 65 100001 1 0:16:06 18:16:58 100001-04 2021-09-04 14:18:24 2021-09-04 14:55:28 25 70.9 100001 4 0:37:04 12:01:55 100001-02 2021-09-04 16:09:11 2021-09-04 16:48:47 55 207 100001 2 0:39:36 16:59:52 100001-04 2021-09-05 12:01:55 2021-09-05 12:09:59 6 51.9 100001 4 0:08:04 16:35:09 100001-03 2021-09-05 16:10:09 2021-09-05 17:04:30 41 153.8 100001 3 0:54:21 11:30:26 100001-04 2021-09-05 16:35:09 2021-09-05 17:00:44 15 55.1 100001 4 0:25:35 14:14:16 100001-02 2021-09-05 16:59:52 2021-09-05 17:43:49 22 70.9 100001 2 0:43:57 15:18:53 100001-01 2021-09-05 18:16:58 2021-09-05 18:31:10 5 65 100001 1 0:14:12 20:06:39 100001-01 2021-09-05 20:06:39 2021-09-05 20:27:27 8 65 100001 1 0:20:48 0:12:45 100001-01 2021-09-06 00:12:45 2021-09-06 00:32:07 3 65 100001 1 0:19:22 17:07:49 100001-04 2021-09-06 14:14:16 2021-09-06 15:40:46 42 60 100001 4 1:26:30 20:54:52 100001-04 2021-09-07 20:54:52 2021-09-07 21:39:22 34 60 100001 4 0:44:30 0:00:00Solved1.7KViews0likes6CommentsDisplay JSON array as column in Power Query
I'm new to power query. I'm parsing JSON. I have an array name as "categories" when I expand it using Power Query it creates three rows for each category while I just want to remain in one row and want to create 3 separate column for each category like category1,category2,category3. here is my code: let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"no", type text}, {"complete", Int64.Type}, {"json", type text}}), #"Parsed JSON" = Table.TransformColumns(#"Changed Type",{{"json", Json.Document}}), #"Expanded json" = Table.ExpandRecordColumn(#"Parsed JSON", "json", {"title", "price", "StoreName", "ratings", "merchant", "categories", "VariantB", "detailA", "detailB", "bullets", "images", "description"}, {"title", "price", "StoreName", "ratings", "merchant", "categories", "VariantB", "detailA", "detailB", "bullets", "images", "description"}) in #"Expanded json" Here is my JSON; { "title": "Braun 6-in-1 All-in-one Trimmer 3 MGK3221, Beard Trimmer for Men, Hair Clipper and Face Trimmer with Lifetime Sharp Blades, Ear & Nose Trimmer Head, 5 Attachments, Black/Volt Green, UK Two Pin Plug", "price": "£30.49", "StoreName": "Braun", "ratings": "4.5", "merchant": "Amazon", "categories": [ "Shaving & Hair Removal", "Trimmers, Clippers & Body Groomers", "Hair Clippers" ], "VariantB": { "MGK 3221": "B0842P7BRK", "MGK 3245": "B0842PDGRK" }, "detailA": { "Product Name": "Braun 6-in-1 Trimmer MGK3221", "Units": "1 count", "Brand": "Braun" }, "detailB": { "ASIN": "B0842P7BRK" }, "bullets": [ "Rechargeable all-in-one trimmer with unprecedented cutting performance vs. previous generations of Braun beard trimmers", "6-in-1 beard trimmer, face and hair trimmer for men's grooming", "Lifetime Sharp Blades and 13 length settings for utmost styling precision", "NiMH battery for 50 minutes of trimming with 10 hour charge", "Designed and engineered in Germany by Braun", "Clip hair to the length you need, simply attach the short & long hair combs, good for cutting hair from 0.5 to 21 mm" ], "images": [ "https://images-na.ssl-images-amazon.com/images/I/813c6SQbWoL._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/91HnJxkPEML._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/81fTXUsQRML._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/91SRO6XOChL._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/81-h71RecyL._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/81Xo4qcb4mL._AC_SL1500_.jpg", "https://images-na.ssl-images-amazon.com/images/I/8145FOZPbAL._AC_SL1500_.jpg" ], "description": "<div id=\"productDescription\" class=\"a-section a-spacing-small\"><div class=\"disclaim\">Style Name:<strong>MGK 3221</strong></div><!-- show up to 2 reviews by default --><h3>Product Description</h3><p>Master your style with the rechargeable MGK3221, 6-in-1 beard trimmer for men. With Lifetime Sharp Blades and four combs, it offers 13 lengths (0.5-21 mm), so you can easily achieve the look you want across your beard, face and hair.</p><h3>Box Contains</h3><p></p><ul><li>1 x Beard and hair trimmer</li> <li>1 x Ear and Nose trimmer attachment</li> <li>4 x comb attachments</li> <li>1 x Smart plug charger</li></ul></div>" } I want to show each object and array as a seperate column in one row. Thanks in advance for any kind of help!Solved10KViews0likes1Comment