Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hi - hoping someone can help with the DAX needed for a measure to do the following
I have a table of data which has an open date and close date in it. I need to be able to create a line graph which shows the number of cases that were open at the end of each month on a month by month basis.
Thanks
Solved! Go to Solution.
I have now resolved this by adding a Month Start and Month End Column to my Calendar reference table and then building the following measure:
CountOpenME = CALCULATE ( COUNT( 'Table'[Stud ID] ), FILTER ( GENERATE ( 'Table', 'Calendar' ), 'Table'[Open Date] <= 'Calendar'[MonthEnd] && OR('Table'[Close Date] > 'Calendar'[MonthEnd],'Table'[Close Date]=BLANK()) ) )
Hi @Anonymous ,
You can try to use following measure if it suitable for your requirement:
Measure = VAR currDate = MAX ( Date[Date] ) RETURN CALCULATE ( COUNT ( Table[Column] ), FILTER ( ALLSELECTED ( Table ), [OpenDate] <= currDate && OR ( [CloseDate] > currDate, [CloseDate] = BLANK () ) ) )
Regards,
Xiaoxin Sheng
Thank you - however, this isn't quite doing what I need it to.
To calrify - my calendar table has dates spanning 100 years as a reference table.
I am trying to get the data in the example in my first post to look like this:
Thanks
KH
I have now resolved this by adding a Month Start and Month End Column to my Calendar reference table and then building the following measure:
CountOpenME = CALCULATE ( COUNT( 'Table'[Stud ID] ), FILTER ( GENERATE ( 'Table', 'Calendar' ), 'Table'[Open Date] <= 'Calendar'[MonthEnd] && OR('Table'[Close Date] > 'Calendar'[MonthEnd],'Table'[Close Date]=BLANK()) ) )
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
72 | |
67 | |
65 | |
43 | |
42 |
User | Count |
---|---|
47 | |
38 | |
28 | |
28 | |
27 |