The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to create new columns from values from one column in power bi. How do I do that? Let's say for instance from the table below, I want to create new columns for different states from the state column that will count the number of companies that are headquartred in that state, how will I do that in power bi
Company Id | Company Name | States | Alabama | Texas | Illinois | Michigan | Ohio |
1 | Xtech | Alabama | 2 | 4 | 1 | 2 | 3 |
2 | Coliq | Texas | |||||
3 | Fimtec | Illinois | |||||
4 | Witnog | Michigan | |||||
5 | Gnamew | Ohio | |||||
6 | Zenith | Texas | |||||
7 | Lever | Michigan | |||||
9 | Gum | Texas | |||||
10 | Hunlec | Ohio | |||||
11 | Girthlow | Ohio | |||||
12 | Tetlow | Alabama | |||||
13 | Doughlas | Texas |
New Table =
ROW (
"Alabama", COUNTROWS ( FILTER ( Data, Data[States] = "Alabama" ) ),
"Texas", COUNTROWS ( FILTER ( Data, Data[States] = "Texas" ) ),
"Illinois", COUNTROWS ( FILTER ( Data, Data[States] = "Illinois" ) ),
"Michigan", COUNTROWS ( FILTER ( Data, Data[States] = "Michigan" ) ),
"Ohio", COUNTROWS ( FILTER ( Data, Data[States] = "Ohio" ) )
)
https://www.dropbox.com/s/lr6vx7fu3fv8m1j/joparaugo.pbix?dl=0
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
8 | |
7 |