Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi there,
I have a column called [result_value] that has multiple rows, for example, the most common row is "Art & Design" there are 12 rows with that specific value, I want a % calculated from that.
It looks quite simple but I haven't found a way to do it surprisingly. I want to see the total % of the top value in comparison to the rest of the entries, not just specifically "Art & Design", as there might be other values in future that surpass it.
Solved! Go to Solution.
Hi @Anonymous
This should work in a cadr visual
Most Common % =
VAR CountAll =
COUNTROWS ( TableName )
VAR ValuesFrequency =
ADDCOLUMNS (
TableName,
"@Frequency",
COUNTROWS (
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[result_value] ) )
)
)
VAR MaxFrequency =
MAXX ( ValuesFrequency, [@Frequency] )
RETURN
DIVIDE ( MaxFrequency, CountAll )
Hi @Anonymous
This should work in a cadr visual
Most Common % =
VAR CountAll =
COUNTROWS ( TableName )
VAR ValuesFrequency =
ADDCOLUMNS (
TableName,
"@Frequency",
COUNTROWS (
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[result_value] ) )
)
)
VAR MaxFrequency =
MAXX ( ValuesFrequency, [@Frequency] )
RETURN
DIVIDE ( MaxFrequency, CountAll )
@Anonymous
The last part use CountAll not the table name
Apologies @tamerj1 I'm not sure why I did that... I must have read it wrong, anyway it works now greatly appreciate it.
@Anonymous
Please do not apologies. It was actually my mistake. Please accept my appology and thank you for marking my reply as acceptable solution.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
9 | |
7 |