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 September 15. Request your voucher.
I have a table like this
Field 1 | Field 2 | Field 3 |
10 | 10 | 30 |
30 | 30 | 10 |
10 | null | 30 |
10 | 30 | 10 |
30 | 30 | 30 |
And I would like to generate a new column that will count how many '30' exists in each row.
For this example, the result would be:
Field 1 | Field 2 | Field 3 | Counter |
10 | 10 | 30 | 1 |
30 | 30 | 10 | 2 |
10 | null | 30 | 1 |
10 | 30 | 10 | 1 |
30 | 30 | 30 | 3 |
What is the best solution for this?
It will be easier to do this from DAX or by creating an advanced query.
Thank you!
Solved! Go to Solution.
try a calculated column
Counter= ([Field 1]=30)+([Field 2]=30)+([Field 3]=30)
try a calculated column
Counter= ([Field 1]=30)+([Field 2]=30)+([Field 3]=30)
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |