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
MahaAli_00
New Member

Calculate distinct count with accurate sum

MahaAli_00_0-1696608985957.png

Hi I want to calculate the distinct count of column "COLL_ACTIVE" which filters out the total "COMM_TARGET%" witha a range but I am getting wrong values I have used multiple Measure to calculate this what I am using right now is 

50%-69.9%(Q) = CALCULATE(DISTINCTCOUNTNOBLANK(MainList[COLL_Active]),FILTER(MainList,MainList[COMM_T%]>=50 && MainList[COMM_T%]<=69.9))+0

'Mainlist' is the table name "COMM_T" it is returning me blank but I have COLL_ACTIVE that has total of more than 50, how should I do it please help 

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

Hi @MahaAli_00 ,

 

What's the difference between [COMM_T%] and [COMM_TARGET%]? Based on my understanding, [COMM_TARGET%] is a column.

To find out a possible solution, I created sample data and a measure. Please refer to

vstephenmsft_1-1696929512032.png

Measure = CALCULATE(DISTINCTCOUNT('MainList'[COLL_Active]),FILTER('MainList',[COMM_TARGET%]>=50&&[COMM_TARGET%]<=69.9))

The measure in the card visual:

vstephenmsft_2-1696929545757.png

Best Regards,

Stephen Tao

 

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

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @MahaAli_00 ,

 

What's the difference between [COMM_T%] and [COMM_TARGET%]? Based on my understanding, [COMM_TARGET%] is a column.

To find out a possible solution, I created sample data and a measure. Please refer to

vstephenmsft_1-1696929512032.png

Measure = CALCULATE(DISTINCTCOUNT('MainList'[COLL_Active]),FILTER('MainList',[COMM_TARGET%]>=50&&[COMM_TARGET%]<=69.9))

The measure in the card visual:

vstephenmsft_2-1696929545757.png

Best Regards,

Stephen Tao

 

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

pradeep_kare12
Resolver I
Resolver I

@MahaAli_00  try this dax function 

 

DebugTable =
SUMMARIZECOLUMNS (MainList[COMM_T%],
"Distinct Count", DISTINCTCOUNTNOBLANK(MainList[COLL_Active])
)

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.