Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Need help in filtering using measure in power bi

I have 2 measures in my power bi report which show cumulative trend based on two date columns namely created date and closed date. The 2 trend lines show total number of bugs created vs total number of closed bugs at specific dates.
enter image description here

Total Created Bugs:

Measure1 = CALCULATE(COUNTROWS(Sheet1),FILTER(ALLSELECTED(Sheet1),Sheet1[CreatedDate]<=MAX(Sheet1[CreatedDate])))

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Total Closed Bugs:

Measure2 = var totalEpics= CALCULATE( COUNTROWS(Sheet1),
FILTER ( ALL(Sheet1),
IF(Sheet1[ClosedDate] <> BLANK() ,Sheet1[ClosedDate] <= MAX(Sheet1[CreatedDate]),0))) var val = IF(ISBLANK(totalEpics),0,totalEpics) RETURN val

enter image description here

Issue is that If I change the date in slicer then measure1 is recalculated correctly but measure 2 is not recalculating according to slicer

enter image description here

>Solution :

What happens if you replace ALL with ALLSELECTED

Measure2 = var totalEpics= CALCULATE( COUNTROWS(Sheet1), FILTER ( ALLSELECTED(Sheet1), IF(Sheet1[ClosedDate] <> BLANK() ,Sheet1[ClosedDate] <= MAX(Sheet1[CreatedDate]),0))) var val = IF(ISBLANK(totalEpics),0,totalEpics) RETURN val
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading