gpt4 book ai didi

FOR EACH Loop DAX(对于每个环路DAX)

转载 作者:bug小助手 更新时间:2023-10-24 21:50:16 25 4
gpt4 key购买 nike



I have a table of excel data called "Export" that I imported into Power BI. I want to create a second table that lists normalization of my data.

我有一个名为“导出”的Excel数据表,我将其导入到Power BI中。我想创建第二个表,列出我的数据的标准化。


I have some script someone else did for me in excel but I don't know how it can be converted into DAX.
Column V is equal to Aluminum and X is Boron in this example.

我有一些别人在EXCEL中为我做的脚本,但我不知道如何将其转换为DAX。在本例中,V栏等于铝,X是硼。


```
Dim User As String
Dim LastRow As Long
Dim Ws As Worksheet

Set Ws = ActiveSheet
LastRow = Ws.Cells(Ws.Rows.Count, "A").End(xlUp).Row

'****Aluminum
Range("V:V").EntireColumn.Insert (Shift = xlToRight)
Range("V1").Value = "Norm_Al"
Range("v2:V" & LastRow).Formula = "=IfError(Sum(U2 / O2 * 100), """")"
Range("v2:V" & LastRow).Formula = Range("v2:V" & LastRow).Value

'****Boron
Range("X:X").EntireColumn.Insert (Shift = xlToRight)
Range("X1").Value = "Norm_B"
Range("X2:X" & LastRow).Formula = "=IfError(Sum(W2 / O2 * 100), """")"
Range("X2:X" & LastRow).Formula = Range("X2:X" & LastRow).Value
```

Expected Results are attached
enter image description here

预期结果附在此处输入图像描述


更多回答
优秀答案推荐


I want to create a second table that lists normalization of my data.



In PowerBI, you don't use DAX to normalize your data like you (can) do in SQL by creating normalized views. instead, you restructure/normalize your tables in PowerQuery.

在PowerBI中,您不会像在SQL中通过创建规范化视图来(可以)使用DAX来标准化数据。相反,您需要在PowerQuery中重新构造/规范化您的表。


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com