cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Dax Measure to Count No of Days with Condition

Hi,

I'm new in DAX, and I'm having a problem in counting the number of days with a condition. I need a measure that will count the days passed from the slicer date where the GL OB is more than the Amort OB and will stop the count if there will be a date where the Amort OB is more than equal the GL OB. Please see the table below (The No. of days column is the result of the measure I needed):

 Date Amort OB GL OB NO OF DAYS Sep-19 10,000 12,000 0 Oct-19 8,000 8,000 0 Nov-19 6,000 8,000 31 Dec-19 4,000 8,000 61
3 REPLIES 3
New Member
Can someone assist me. I am pulling the bug report from azure DevOps to power BI. When I add the defect count to a month chart, it is showing the defects incremented each month. What I need is for the count of defects displayed to start over each month. So if January and February had 250 defects. January should display 125 and February should display 125 not January shows 125 and February shows 250 and the data shows the increase between months and not how many each month. Please help!!
Anonymous
Not applicable

Could not solve in one measure. Created a column and measure
First column: If amount GL OB is greater then Amort OB

IsGLgtOB = IF(Test[GL OB]>Test[Amort OB],1)
Second measure = date difference
NoOfDays =
VAR CurrentDate = MAX(Test[Date])
VAR OB = CALCULATE(SUM(Test[Amort OB]),Test[Date]=CurrentDate)
VAR PrevDate = CALCULATE(MAX(Test[Date]),Test[IsGLgtOB]=0,Test[Date]<CurrentDate)
RETURN IF(MAX(Test[IsGLgtOB])=1,DATEDIFF(PrevDate,CurrentDate,DAY),0)
Helper I

Can this be solve without adding a column?

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.