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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello all,
Apologize for messy/confusing title.
I'm fairly new to Power BI and DAX thing, so I have a question about dividing a sum of the number from a group with the count number of the group itself.
I have 2 tables. Transactions Table (Trx Table) and a table from Google Analytics.
I have this sessions value of the source/medium from the GA table
| Date | Source | Medium | Source/Mediun | Sessions |
| 12 03 2022 | cpc | googlecpc | 6963 | |
| 12 03 2022 | cpc | facebookcpc | 856 |
Which is 6963 for googlecpc sessions
and I want to divide it with the count transactions number of that group in the Transactions Table
| Date | Source/Medium | Status |
| 12 03 2022 | googlecpc | Success |
| 12 03 2022 | googlecpc | Fail |
| 12 03 2022 | googlecpc | Success |
| 12 03 2022 | googlecpc | Fail |
| 12 03 2022 | googlecpc | Success |
which in that table there are 5 transactions from googlecpc.
So, the calculations for the date 6 March will be 6963 divided by 5.
Anyone know how to create the DAX for this? I already tried to do research but still found no appropriate formula
Thank you!
Solved! Go to Solution.
Hi @aglpr ,
How about this:
I used this formular:
TomsDivideMeasure =
DIVIDE (
CALCULATE (
SUM ( TableGA[Sessions] )
),
CALCULATE (
COUNTROWS ( TableTrx )
)
) Does this get you closer to a solution? 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hi @aglpr ,
How about this:
I used this formular:
TomsDivideMeasure =
DIVIDE (
CALCULATE (
SUM ( TableGA[Sessions] )
),
CALCULATE (
COUNTROWS ( TableTrx )
)
) Does this get you closer to a solution? 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hello Tom,
Thank you so much for the formula. Actually I mistype the expected calculations. It should be 5 divided by 6963, not 6963 divided by 5. But I change the order of the formula provided by you and it works! Keep forgotting how advanced the CALCULATION is
Thank you so much!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |