Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Having two different measures in same dataset - one for Total and another for group by total

I have created two different mesaures to have overall count and TypeCount by grouping.

Mesaure

TotalCount = DISTINCTCOUNT(Query1[Product])
TotalTypeCount = 
TotalIncidentCountByGroupForMonitor = CALCULATE ( COUNT ( Query1[Product] ), ALLEXCEPT ( Query1, Query1[Type] ))
 

Raw Data : 

ProductType
AX
BY
CZ
DX
EX

 

Expected Output in Table/Matrix :

TypeTypeCountOverall Total% of Total
X3560
Y1520
Z1520

 

But getting Output in Table/Matrix when adding the Type :

TypeTypeCountOverall Total% of Total
X33100
Y11100
Z11100

 

Can you please help me to acheive my desired output

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

 

Single group statistics::

1. Create calculated table.

Table =
var _count1=COUNT('Row Data'[Type])
var _1=COUNTX(ALL('Row Data'),'Row Data'[Type])
var _2=
SUMMARIZE('Row Data','Row Data'[Type],
"Type Count",COUNT('Row Data'[Type]),
"Overall",COUNTX(ALL('Row Data'),'Row Data'[Type]))
return _2

2. Create calculated column.

percen = DIVIDE('Table'[Type Count],'Table'[Overall])

3. Result.

v-yangliu-msft_0-1605490108769.jpeg

Multiple statistical groups:

1. Create calculated table.

Table 2 =
var _count1=COUNT('Row Data'[Type])
var _1=COUNTX(ALL('Row Data'),'Row Data'[Type])
var _2=
SUMMARIZE('Row Data','Row Data'[Week],'Row Data'[Type],
"Type Count",COUNT('Row Data'[Type]),
"Overall",COUNTX(ALL('Row Data'),'Row Data'[Type]))
return _2

2. Create calculated column.

Percen =
DIVIDE('Table 2'[Type Count],'Table 2'[Overall])

3. Result.

v-yangliu-msft_1-1605490108770.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous ,

I am getting the expected results

Measure = count('Table (3)'[Type])
Measure 2 = CALCULATE(count('Table (3)'[Type]), ALL('Table (3)'[Type]))
Percen = DIVIDE([Measure],[Measure 2])

 

Screenshot 2020-11-12 12.35.42.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

ravikzm_1-1605167748362.png

Can you please help me to get the correct count when grouping by more than 1 column

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors