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 need your help.
I require an analysis of the frequency of different columns. The basis I have is like this:
And he needed to make a table showing the country with its respective frequency percentage considering the 4 columns.
I'm very grateful for your help!
Solved! Go to Solution.
Hi @Mayan ,
My 100% stacked column chart looks like this:
2.Using the following formula:
//Filter out the different values in the four columns as a table(column)
All values table =
DISTINCT (
UNION (
DISTINCT ( 'Counting values'[Pais1] ),
DISTINCT ( 'Counting values'[Pais2] ),
DISTINCT ( 'Counting values'[Pais3] ),
DISTINCT ( 'Counting values'[Pais4] )
)
)
//Count of different values in each column
COUNT1 =
CALCULATE (
COUNT ( 'Counting values'[Pais1] ),
FILTER (
'Counting values',
'Counting values'[Pais1] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT2 =
CALCULATE (
COUNT ( 'Counting values'[Pais2] ),
FILTER (
'Counting values',
'Counting values'[Pais2] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT3 =
CALCULATE (
COUNT ( 'Counting values'[Pais3] ),
FILTER (
'Counting values',
'Counting values'[Pais3] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT4 =
CALCULATE (
COUNT ( 'Counting values'[Pais4] ),
FILTER (
'Counting values',
'Counting values'[Pais4] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
My 100% stacked column chart looks like this:
Hi @Mayan ,
My 100% stacked column chart looks like this:
2.Using the following formula:
//Filter out the different values in the four columns as a table(column)
All values table =
DISTINCT (
UNION (
DISTINCT ( 'Counting values'[Pais1] ),
DISTINCT ( 'Counting values'[Pais2] ),
DISTINCT ( 'Counting values'[Pais3] ),
DISTINCT ( 'Counting values'[Pais4] )
)
)
//Count of different values in each column
COUNT1 =
CALCULATE (
COUNT ( 'Counting values'[Pais1] ),
FILTER (
'Counting values',
'Counting values'[Pais1] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT2 =
CALCULATE (
COUNT ( 'Counting values'[Pais2] ),
FILTER (
'Counting values',
'Counting values'[Pais2] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT3 =
CALCULATE (
COUNT ( 'Counting values'[Pais3] ),
FILTER (
'Counting values',
'Counting values'[Pais3] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
COUNT4 =
CALCULATE (
COUNT ( 'Counting values'[Pais4] ),
FILTER (
'Counting values',
'Counting values'[Pais4] = SELECTEDVALUE ( 'All values table'[distinct values] )
)
)
My 100% stacked column chart looks like this:
@Mayan , The best way is to unpivot the column.
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/
The second way is to join all four columns with a country table, one active and three inactive joins will be there. Then create four-count measure using userelation and sum that up
The easiest way to do this is to unpivot these 4 columns in the query editor. You will then have a table with two columns (Attribute and Value, unless you name them otherwise). You can then make a Table visual with the Value column, with a simple measure to count the number of rows.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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 |
---|---|
110 | |
94 | |
80 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |