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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count

Hello Community

 

My data is as follows and i am expecting get the results as the last column (Lines Count) in bold letter

basically i would like to display how many lines are there in a perticular order using a count function in a measure

(i am trying to get this total count of order, for each line)

 

Order#

Line#

Qty

Lines Count

123

1.1

10

2

123

2.1

20

2

228

1.1

15

3

228

3.1

30

3

228

4.1

18

3

213

2.1

12

1

 

 

Using count function i am able to get the expected results, when i just take Order number column, but as soon as i add additional columns (Line#, Qty) in the table visulization, i am getting the Lines count as 1 for all lines..

 

Order#

Count of Lines

123

2

228

3

213

1

 

Appreciate your help..

 

Thanks,

 

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

@Anonymous,

 

Modify your measure like below and try again:

Lines Count = CALCULATE(COUNT(Table1[Order#]), ALLEXCEPT(Table1, Table1[Order#]))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

Anonymous
Not applicable

Hello Support team,

 

thanks for quick turn around..

 

I tried the below formula, it works good with lines count, but the problem is, some rows are getting duplicated, i am now getting more rows with my original data..

 

Regards,

Anonymous
Not applicable

I have a join to another table, and one of the column from 2nd table is also displayed, in such cases i am getting a duplicate row for that order..

@Anonymous ,

 

Just remove Line and #Qty column in values field.

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

Anonymous
Not applicable

Dear Support Team

 

as i indicated in my original request, i am getting the count when i just display the order number

but my requirement is to the count when all the fields are in the table

 

thanks,

 

@Anonymous ,

 

In query editor, click transform and then click remove duplicate rows.

 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors