Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I want want to get the repartition on a string variable.
The variable is "COUNTRY" :
COUNTRY | NOTE |
Italy | 90 |
Italy | 90 |
China | 90 |
and i want to get
COUNTRY | NOTE | Wheight |
Italy | 90 | 66% |
Italy | 90 | 66% |
China | 90 | 33% |
Maybe it is'nt yhe good wqay to do things. What i realy want is to exclude contry who have fews rows because they don't contribute but appears when i use median or average.
I am new in power BI so sorry if the answer is obvious.
Data source : data
Solved! Go to Solution.
Hi @MaxPav
You can use DIVIDE dax to calculate the percentage of the number of rows in different countries to the total number of rows .
Measure = DIVIDE(COUNTA('Table'[COUNTRY]),CALCULATE(COUNTA('Table'[COUNTRY]),ALL('Table')))
More info about the usage for DIVIDE dax can refer to the link :
https://docs.microsoft.com/en-us/power-bi/guidance/dax-divide-function-operator
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MaxPav
You can use DIVIDE dax to calculate the percentage of the number of rows in different countries to the total number of rows .
Measure = DIVIDE(COUNTA('Table'[COUNTRY]),CALCULATE(COUNTA('Table'[COUNTRY]),ALL('Table')))
More info about the usage for DIVIDE dax can refer to the link :
https://docs.microsoft.com/en-us/power-bi/guidance/dax-divide-function-operator
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello myself,
I found this solution.
Step 1 : Power Query
#"Personnalisée ajoutée" = Table.AddColumn(#"Autres colonnes supprimées", "Personnalisé", each 1),
#"Personnalisée ajoutée1" = Table.AddColumn(#"Personnalisée ajoutée", "Personnalisé.1", each List.Sum(#"Personnalisée ajoutée"[Personnalisé])),
#"Colonnes renommées1" = Table.RenameColumns(#"Personnalisée ajoutée1",{{"Personnalisé.1", "Nb ligne"}}),
#"Autres colonnes supprimées1" = Table.SelectColumns(#"Colonnes renommées1",{"Num_Ligne", "country", "points", "price", "province", "region_1", "region_2", "title", "variety", "winery", "Nb ligne"})
Step 2 : Power BI, measures
Nb_Ligne_Country = COUNTA('winemag-data-130k-v2'[country])
TotalLigne = MAX('winemag-data-130k-v2'[Num_Ligne])
Poids = [Nb_Ligne_Country]/[TotalLigne]
I put this solution in case someone really needs it. However I think there must be a cleaner solution.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |