New-PowerBIColumn
建立新的 Power BI 資料行物件。
Syntax
New-PowerBIColumn
-Name <String>
-DataType <PowerBIDataType>
[<CommonParameters>]
Description
起始建立新的 Power BI 資料行物件。 資料行是建構資料表物件的建置組塊。
範例
範例 1
PS C:\>$col1 = New-PowerBIColumn -Name ID -DataType Int64
PS C:\>$col2 = New-PowerBIColumn -Name Data -DataType String
PS C:\>$table1 = New-PowerBITable -Name SampleTable1 -Columns $col1,$col2
PS C:\>
PS C:\>$col3 = New-PowerBIColumn -Name ID -DataType Int64
PS C:\>$col4 = New-PowerBIColumn -Name Date -DataType DateTime
PS C:\>$col5 = New-PowerBIColumn -Name Detail -DataType String
PS C:\>$col6 = New-PowerBIColumn -Name Result -DataType Double
PS C:\>$table2 = New-PowerBITable -Name SampleTable2 -Columns $col3,$col4,$col5,$col6
PS C:\>
PS C:\>$dataset = New-PowerBIDataSet -Name SampleDataSet -Tables $table1,$table2
PS C:\>
PS C:\>Add-PowerBIDataSet -DataSet $dataset
本範例會具現化具有兩個數據行的資料表,另一個具有四個數據行的資料表,並具現化資料集。 然後,它會在 Power BI 中建立資料集。
參數
-DataType
資料行的類型。
Type: | PowerBIDataType |
Accepted values: | Int64, Double, Boolean, DateTime, String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
資料行名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸出
Microsoft.PowerBI.Common.Api.Datasets.Column
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應