Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi team, I am very new to Power BI and come across my first question, I have a table where contains the sales amount and team, dates, sample as below:
| Agent name | Agent Team | Sales date | Sales total |
| Lucy | Team A | 30/07/2020 | 3 |
| Marin | Team A | 31/09/2020 | 2 |
| Charcy | Team B | 1/08/2020 | 1 |
| Chris | Team C | 2/08/2020 | 5 |
I am using Agent team as a slice in Power BI, then I want to calculate the percentage of Sales of each person baes on my selection of teams, for example, if I dont select any team then it will be calculated based on the whole table, the result will be like:
| Sales total | Percentage | |
| Lucy | 3 | 27.27% |
| Marin | 2 | 18.18% |
| Charcy | 1 | 9.09% |
| Chris | 5 | 45.45% |
but if I select Team A, the percentage will need to calculates based on the total sales of Team A.
| Sales total | Percentage | |
| Lucy | 3 | 60.00% |
| Marin | 2 | 40.00% |
I know we can use the "Percentage of grad total" to show similar results, but I would like to create it as a measure so I can re-use this value.
I tried to use DAX below:
Solved! Go to Solution.
@Anonymous , Try with allselected
Pct Team =
VAR Personal =
sum('table'[Sales Total])
VAR ALLteam=
SUMX(
allselected('table'),
'table'[Sales Total]
)
DIVIDE(Personal, ALLteam)
@Anonymous , Try with allselected
Pct Team =
VAR Personal =
sum('table'[Sales Total])
VAR ALLteam=
SUMX(
allselected('table'),
'table'[Sales Total]
)
DIVIDE(Personal, ALLteam)
It worked, thanks 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |