Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all,
you will find below a sample data
| Id | Year | Stats |
| 1 | 2021 | Oui |
| 2 | 2021 | Oui |
| 3 | 2021 | Oui |
| 4 | 2021 | Non |
| 5 | 2021 | Non |
| 6 | 2021 | Oui |
| 7 | 2021 | Oui |
| 8 | 2020 | Oui |
| 9 | 2020 | Oui |
| 10 | 2020 | Oui |
| 11 | 2020 | Non |
i want to use that data to create the visual below, that shows the camparaison of stats between the year 2021 & the year 2020.
My problem in that visual is that the subtotal per year is not 100%, but the pourcentage is calculated in the basis of the two years!
Pratically, i want to see that in the year 2020 we had 75% of "Oui" and 25% of "Non" , and in the year 2021 i had 62,5% of "Oui" and 37,5% of "Non".
The result i'm getting from my measure is not what i really need :
Here is the Measure created for this sample data :
Can you help me ?
Thankfully,
A.K
Solved! Go to Solution.
Hi @Anonymous
Try this measure:
Measure =
Var _A = COUNTROWS('Table')
Var _B = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Year]))
return
_A/_B
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi,
You may download my PBI file from here.
Hope this helps.
Hi @Anonymous
Try this measure:
Measure =
Var _A = COUNTROWS('Table')
Var _B = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Year]))
return
_A/_B
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi,
You may download my PBI file from here.
Hope this helps.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |