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
VIPINGARG
Frequent Visitor

Total is not working

My total calculation is not working in below example:

Data:

Shee1:

 

IDCHANNEL
1A
2A
3A
5A
6A
7A
1B
2B
4B
6B
7B
1C
2C
3C
7C

 

Table:

Value
1
2
3

 

pls find below screenshot of power bi measure and attribute

 

VIPINGARG_0-1681012062583.png

 

 

 

I need some of rows in total.

 

@PowerBI 

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @VIPINGARG .
In order to achieve a correct count, you need to take two measures:
1.counterID = DISTINCTCOUNT('Table'[CHANNEL])
2. 
TotallDistinct = if(HASONEFILTER('Table'[ID]),[counterID],

sumx(distinct('Table'[ID]),[counterID]))
Ritaf1983_0-1681015372074.png

Link to sample file 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you for your reply. I frorgot to tell one thing here. I am trying to calculate here is that one ID is coming in how many distinct channel. As I have Max 3 channels here, I can get 1 or 2 or 3 count. Means How many IDs are coming in only one channel and How many IDs are coming two channel and how many IDs are coming in three channels.

That's fine, my formula does exactly that.
Please note that ID 1 in my table has duplicate channels.

Ritaf1983_0-1681017610499.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.