The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
Could you please help me anyone how to calculate PERCENTAGES based on a single column TOTAL in Power BI in measures
Solved! Go to Solution.
Thanks for the reply from@gmsamborn and@vicky_please allow me to provide another insight:
Hi,@ktkpatra
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Create calculated table references:
new =
VAR SUM1=SUM('Table'[value])
VAR Percent1=
SUMMARIZE (
'Table',
[Column1],
"month", "_Percent of total",
"value",SUM('Table'[value])/SUM1
)
VAR TAOTAL1=
SUMMARIZE (
'Table',
[Column1],
"month", "_Total",
"value",SUM('Table'[value])
)
RETURN
UNION ('Table', Percent1,TAOTAL1)
3.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
No, It will not solve my problem and not calcualte exact percentage.
Please help me with DAX query to find out percent of total in column
Thanks for the reply from@gmsamborn and@vicky_please allow me to provide another insight:
Hi,@ktkpatra
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Create calculated table references:
new =
VAR SUM1=SUM('Table'[value])
VAR Percent1=
SUMMARIZE (
'Table',
[Column1],
"month", "_Percent of total",
"value",SUM('Table'[value])/SUM1
)
VAR TAOTAL1=
SUMMARIZE (
'Table',
[Column1],
"month", "_Total",
"value",SUM('Table'[value])
)
RETURN
UNION ('Table', Percent1,TAOTAL1)
3.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ktkpatra
Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
A .pbix file with sample data would be best.
Hi @ktkpatra
Besides the solution provided by @vicky_ , you could use 2 measures like these.
Amt = SUM( 'Table'[Amt] )
Pct of Total =
DIVIDE(
[Amt],
CALCULATE(
[Amt],
ALL( 'Table' )
)
)
Here is an example.
Let me know if you have any questions.
For simple cases of implicit and explicit aggregations or measures, you can use the built-in row, column or grand total %s. Right click on the field > Show value as > whichever you want.
If you have a more complex calculation requirement, then you need to post some sample data (with any sensitive information removed) so that someone can provide more specific help.
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |