cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User II
Super User II

@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.






View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors