Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello.
I have about 20 fields of free text. Each field has a corresponding "Grade", which is either Green, Yellow or Red (100000000, 100000001, 100000002). I want a column in Power BI, that will total all the "Greens" for the Row, and a column that will total all the "Reds" for the row, etc.
Ideally, for each row, we would then have totals of Green grades, Red grades, and Yellow grades.
It doesn't look like countx is suitable for this.
I would appreciate advice. Thank you.
Solved! Go to Solution.
@Unicorn_Tech You want MC Aggregations: https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...
That said, you might considering unpivoting your columns as well as that tends to be a better format for analysis.
Hi @Unicorn_Tech ,
Try like below :
step1, create new table use following dax:
Table2 = CALCULATETABLE(DISTINCT('Table'[Column]))
Step2,then create new column:
Column 2 = IF('Table2'[Column]=100000000,"Green",IF('Table2'[Column]=100000001,"Yellow","Red"))
Step 3, create the following measure:
Measure2 = var test=CALCULATE(COUNT('Table'[Column]),FILTER(ALL('Table'),'Table'[Column]=MAX(Table2[Column]))) RETURN test
Measure3 = var test= SUMX(Table2,[Measure2]) return
IF(HASONEVALUE(Table2[Column 2]),MAX(Table2[Column 2])&"="&test,"Total"&"="&test)
Final get :
Wish it is helpful for you!
Best Regards
Lucien
@Unicorn_Tech , can you share the expected output
you can have something like
example
A new column = sumx(Table, [Grade] = earlier([Grade]) , [Value])
A new Measure= sumx(allselected(Table), [Grade] = max([Grade]) , [Value])
My expected output:
I have 20 columns which either have the value of 100000000 or 100000001 or 100000002.
I expect the output to be:
Green = count of all 100000000 that appear within the row, across all columns.
Yellow= countof all 100000001 that appear within the row, across all the columns.
Red = count of all 100000002 that appear within the row, across all columns.
So a sample for a particular row:
Green = 15
Yellow = 2
Red = 3
@Unicorn_Tech You want MC Aggregations: https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...
That said, you might considering unpivoting your columns as well as that tends to be a better format for analysis.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
66 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |