Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Creating a Dynamic Attribute Name Column in Power BI Using Power Query
In this guide, we demonstrate how to create a custom column in Power BI that dynamically identifies the attribute name based on non-null values across multiple columns. This technique is useful for datasets where different columns hold values for different categories (e.g., sales data for various product types). We’ll cover two distinct scenarios using Power Query:
Case 1: Only one of the value columns contains data, and the rest are null.
Case 2: Multiple value columns may contain data, and we need to identify the first non-null value starting from a specific column.
Category and Values Example:
Apple | 5 | Value_1 | ||||||||||||||||||||||||||||||||
Apple | 6 | Value_2 | ||||||||||||||||||||||||||||||||
Apple | 8 | Value_3 | ||||||||||||||||||||||||||||||||
Mango | 10 | Value_2 | ||||||||||||||||||||||||||||||||
Mango | 15 | Value_3 | ||||||||||||||||||||||||||||||||
Mango | 23 | Value_1Case 2: Multiple columns may contain data, and we need the first non-null value: Category Value_1 Value_2 Value_3 Attribute Name
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
48 |
User | Count |
---|---|
215 | |
90 | |
83 | |
67 | |
59 |