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

sum of distinct values with multiple filters

hi everyone.

i know that there are many other posts about this topic but i really cannot apply those on my case ( ps: i'm really new with power bi).

what i'm try to do is summarize evere Distinct value of column "Hestimated Hours default"  fitered in order by Project Name.Task List and Task.

 

 with the formula i posted i get this number but it's not correct because it should be higher becauses it doesn't filter for Task List and Task. so ugual hestimated hours by different task list and task is considered just 1 time...

please help me!

Thanks to Everyone!

 

2021-05-10 17_03_09-Window.png

 

 

 

 

aaa.png

 

 

 

Tavola disegno 2.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION

@bmn36501 

If you need the distinct count of the column 'Ore caricate'[Estimated hours default], the use:
Disctinct count EHD = DISTINCTCOUNT(Ore caricate'[Estimated hours default])

Beware that the 0 is considered a value.

If you want the disctinct count of values which are not 0, then use:

Disctinct count EHD =
CALCULATE (
    DISTINCTCOUNT ( 'Ore caricate'[ Estimated hours default] ),
    FILTER ( 'Ore caricate', 'Ore caricate'[ Estimated hours default ] <> 0 )
)

 

 

Create a table (or matrix) visual with the columns Project Name. Task List and Task and add this measure  [Distinct count EHD) (if you are creating a matrix, the measure goes in the "Values" bucket)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@bmn36501 
From the image you posted, it appears you are doing the calculation in a calculated column within a table. For these kind of calculations, where you need the output to be dynamic based on filters, slicers and row context in tables or matrices used on a report page, you need to create measures and then use these measures in visuals. So, insted of adding the calculated column, create a table or matrix visual with the columns you wish to filter the data by and add the measure(s).





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown  i'm trying to make a misure but i really don't now how to make the formula...

@bmn36501 

If you need the distinct count of the column 'Ore caricate'[Estimated hours default], the use:
Disctinct count EHD = DISTINCTCOUNT(Ore caricate'[Estimated hours default])

Beware that the 0 is considered a value.

If you want the disctinct count of values which are not 0, then use:

Disctinct count EHD =
CALCULATE (
    DISTINCTCOUNT ( 'Ore caricate'[ Estimated hours default] ),
    FILTER ( 'Ore caricate', 'Ore caricate'[ Estimated hours default ] <> 0 )
)

 

 

Create a table (or matrix) visual with the columns Project Name. Task List and Task and add this measure  [Distinct count EHD) (if you are creating a matrix, the measure goes in the "Values" bucket)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.