Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm facing the following problem:
I have a table that contains a list of error messages, including the start and end date of that error. I want to create a graph that show me how many errors were active on each date (so where the date is between the start and end date of the error). The X-axis on the graph is based on a separate date table.
Based on some other topics here, I have created the following measure, which works perfectly. However, each error also has a specific error category. With the current measure, it is not possible to filter based on each category. Would anyone be able to provide me with some advice?
Measure:
Solved! Go to Solution.
Hint: Claiming that a measure "works perfectly" is a very risky statement in the world of DAX. It's better to refrain from such statements.
// Please note that 'Date Table' should not have
// any relationship defined with the Errors table.
// Otherwise, this will not work.
[Active Error Count] =
var SelectedDate = SELECTEDVALUE( 'Date Table'[Date] )
var ErrorActiveCount =
// Assuming that Errors stores in each row
// a separate error that is identified with
// ErrorID and Start/End Date fields are not
// blank. If this is not true, the logic must
// be adjusted.
CALCULATE(
COUNTROWS( Errors ),
KEEPFILTERS(
Errors[Start Date] <= SelectedDate
&&
SelectedDate <= Errors[End Date]
)
)
return
ErrorActiveCount
Hint: Claiming that a measure "works perfectly" is a very risky statement in the world of DAX. It's better to refrain from such statements.
// Please note that 'Date Table' should not have
// any relationship defined with the Errors table.
// Otherwise, this will not work.
[Active Error Count] =
var SelectedDate = SELECTEDVALUE( 'Date Table'[Date] )
var ErrorActiveCount =
// Assuming that Errors stores in each row
// a separate error that is identified with
// ErrorID and Start/End Date fields are not
// blank. If this is not true, the logic must
// be adjusted.
CALCULATE(
COUNTROWS( Errors ),
KEEPFILTERS(
Errors[Start Date] <= SelectedDate
&&
SelectedDate <= Errors[End Date]
)
)
return
ErrorActiveCount
User | Count |
---|---|
99 | |
87 | |
80 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |