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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
runatthakorn
Regular Visitor

Row Subtotal from Distinctcount is incorrect

Hi Everyone,

 

I have used Subtotal from Distinctcount in the table and the result is incorrect. I used 2 measures for the calculation below.

 

 

visit(cal) = DISTINCTCOUNT(Spending[date])

 

 

 

Visit = VAR _table = SUMMARIZE(Spending, Spending[member_number], "distinctcount", DISTINCTCOUNT(Spending[date]))
RETURN
SUMX(_table, [visit(cal)])

 

 

The result of subtotal should be (14+24+46) = 84 but in the table shown 83. Please help me to fix it.

Screenshot 2022-03-16 165014.png

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @runatthakorn ,

Refer the below ,according your provided,similar question:

2+2 ,get  total:3

vluwangmsft_0-1648004724987.png

You need to create a new measure:

test = if(HASONEVALUE(Spending[branch_name]),[visit(cal)],SUMX(DISTINCT(Spending[branch_name]),[visit(cal)]))

Output:

vluwangmsft_1-1648004784393.png

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-luwang-msft
Community Support
Community Support

Hi @runatthakorn ,

Refer the below ,according your provided,similar question:

2+2 ,get  total:3

vluwangmsft_0-1648004724987.png

You need to create a new measure:

test = if(HASONEVALUE(Spending[branch_name]),[visit(cal)],SUMX(DISTINCT(Spending[branch_name]),[visit(cal)]))

Output:

vluwangmsft_1-1648004784393.png

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Anonymous
Not applicable

Hi @runatthakorn 

you may have a similar id in rows between two categories, So as your formula is distinct count it counts it only once.

can we have a your data set to verify ?

 



If this post helps, then please consider accepting it as the solution to
help other members find it faster, and give a big thumbs up. 🙂

 

Hi FerhatLyes,

 

Thank you for your reply and for the sample of data set as below.

 

Screenshot 2022-03-16 174249.png

 

I want to use distinct count of date group by member_number and group by branch_name.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.