Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi there, I am trying to get an accurate count of DIMBRANCHID's based on BILLTODIMENTITYID.
For the case above my "test" column should come back as a count of 2 as there is two rows for the same BILLTODIMENTITYID, but there is two DIMBRANCHID's associated with the BILLTODIMENTITYID.
Solved! Go to Solution.
Hi @Michaelbean21 ,
I assume, you would like to create a calculated column which returns the DISTINCT COUNT of DIMBRANCHID (RandomAttribute1) per BILLTODIMENTITYID (GroupingCol). Is this correct? If so, then this one down here should help you:
TableSummarizeCol = VAR _groupingCol = TableGroup[GroupingCol] RETURN CALCULATE ( DISTINCTCOUNT ( TableGroup[RandomAttribute1] ), ALL ( TableGroup ), TableGroup[GroupingCol] = _groupingCol)
If you are only interested in the number of row appearences per group (and independently of the other attribute), then this one should work:
TableSummarizeCol = VAR _groupingCol = TableGroup[GroupingCol] RETURN CALCULATE ( COUNTROWS ( TableGroup ), ALL ( TableGroup ), TableGroup[GroupingCol] = _groupingCol)
Let me know if this helps! If not, feel free to provide some sample data 🙂
/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 @Michaelbean21 ,
I assume, you would like to create a calculated column which returns the DISTINCT COUNT of DIMBRANCHID (RandomAttribute1) per BILLTODIMENTITYID (GroupingCol). Is this correct? If so, then this one down here should help you:
TableSummarizeCol = VAR _groupingCol = TableGroup[GroupingCol] RETURN CALCULATE ( DISTINCTCOUNT ( TableGroup[RandomAttribute1] ), ALL ( TableGroup ), TableGroup[GroupingCol] = _groupingCol)
If you are only interested in the number of row appearences per group (and independently of the other attribute), then this one should work:
TableSummarizeCol = VAR _groupingCol = TableGroup[GroupingCol] RETURN CALCULATE ( COUNTROWS ( TableGroup ), ALL ( TableGroup ), TableGroup[GroupingCol] = _groupingCol)
Let me know if this helps! If not, feel free to provide some sample data 🙂
/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 | |