Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello, I need help with a calculated column. I have a table, call it "Table1" with unique values per category, see example below:
| category | value |
| a | 30 |
| b | 40 |
| c | 50 |
Then I have another table, call it "Table2" like the one below:
| week num | category | value |
| 10 | a | 34 |
| 11 | b | 45 |
| 12 | a | 67 |
| 13 | b | 89 |
I have to create a new column in Table 2 where I add the corresponding value of Table 1 only once, only in the first row, not in each row. how can I achieve it in power bi?
Solved! Go to Solution.
I am thinking perhaps:
Column in Table2 =
VAR __Category = [category]
VAR __MinWeek = MINX(FILTER(ALL('Table2'),[category]=__Category),[week num])
RETURN
IF([week num] = __MinWeek,LOOKUPVALUE('Table1'[value],'Table1'[category],__Category),BLANK())
I am thinking perhaps:
Column in Table2 =
VAR __Category = [category]
VAR __MinWeek = MINX(FILTER(ALL('Table2'),[category]=__Category),[week num])
RETURN
IF([week num] = __MinWeek,LOOKUPVALUE('Table1'[value],'Table1'[category],__Category),BLANK())
Create these two new columns in table 2
Count = countx(filter(table2,table2[category]=earlier(table2[category]) && table2[week num] <=earlier(table2[week num])),table2[week num])
from table 1 = maxx(filter(table1,table2[category]=(table1[category]) && table2[Count]=1),table1[value])
Appreciate your Kudos.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 46 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 88 | |
| 76 | |
| 41 | |
| 26 | |
| 26 |