cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Venson
New Member

Calculate & Filter for a issue number trend chart

Hi, thanks for your time.

i add a measure as below to draw a issue trend chart.

the problem is this measure will only count which the cell which had filled in issue close finish date. it will not count test finish date with blank cell.

how should I solve it ? I have to count the issue still not yet close as well. Many thanks!

(PS: assume issue close date as "today" is not what I want, due to it will have some issue due to make visual)

 

DIR2.0 Count SUM =
VAR Project = 'Dim_Project_List'
VAR DIRlinechart =
CALCULATE
(
    SUM('Issue_ODM'[Custom]),
    FILTER
    (
        'Issue_ODM',
        'Issue_ODM'[Issue Open date]<=MAX('Calendar'[Date]) &&
        'Issue_ODM'[Issue close date]>=MAX('Calendar'[Date])
    )
)
RETURN
    DIRlinechart+0

 

3 REPLIES 3
Venson
New Member

hi all, thanks for your feedback. in the end, I test yours but not suitable what I need.

I attached final code, which is stupid but workable for me 🙂

 

 

Count SUM =
VAR Project = 'Dim_Project_List'
VAR Issue_Count =
CALCULATE
(
    SUM('Issue_ODM'[Custom1]),
    FILTER
    (
        'Issue_ODM',
        'Issue_ODM'[Open]<=MAX('Calendar'[Date]) &&
        'Issue_ODM'[Test Finish (DIR_Open)]>=MAX('Calendar'[Date])
    )
)
VAR Zero_Count =
CALCULATE
(
    SUM('Issue_ODM'[Custom0]),
    FILTER
    (
        'Issue_ODM',
        'Issue_ODM'[Today]>=min('Calendar'[Date])
    )
)
VAR Final =
Issue_Count+Zero_Count

RETURN
if(ISEMPTY('Issue_ODM'),0,Final)
 
2022-08-11 17 05 24.png

 

 
winniz
Frequent Visitor

Hi @Venson ,

 

Please try the formula:

 

DIR2.0 Count SUM =
VAR Project = 'Dim_Project_List'
VAR DIRlinechart =
CALCULATE
(
    SUM('Issue_ODM'[Custom]),
    FILTER
    (
        'Issue_ODM',
        'Issue_ODM'[Issue Open date]<=MAX('Calendar'[Date]) &&
        ( 'Issue_ODM'[Issue close date]>=MAX('Calendar'[Date]) || 'Issue_ODM'[Issue close date] = BLANK() )
    )
)
RETURN
    DIRlinechart+0

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Venson , This is very similar to my HR Blog. Refer blog and files attached

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors