Forum Discussion
alhowarth
Helper I
6 years agoLine chart for success vs failures, and DAX help
I am working with scheduled-jobs data. I would like to create a chart to show the number of success and failures per day. I'm thinking that this would be a line chart, with one line for success and...
- 6 years ago
Here is my Data set: On August 28 and August 29 there are 2 counts.
RUN_DTExit_code
8/27/2020 0 8/28/2020 0 8/28/2020 1 8/28/2020 1 8/29/2020 0 8/29/2020 0 8/29/2020 1 8/30/2020 0 8/30/2020 1 I have used the following measures:
Success = CALCULATE(COUNT('Table'[Exit_code]),'Table'[Exit_code]=0)Failure = CALCULATE(COUNT('Table'[Exit_code]),'Table'[Exit_code]=1)Here's the final visual:Let me know if this resolves your issue.
CNENFRNL
Community Champion
6 years agoHi, alhowarth , based on your description, a DAX equivalent of your sql would be like this,
=
SUMMARIZECOLUMNS (
'Table'[RUN_DT],
'Table'[EXIT_CODE],
"Daily_Count", CALCULATE ( COUNTROWS ( FILTER ( 'Table', 'Table'[EXIT_CODE] <> 0 ) ) )
)
- alhowarth6 years ago
Helper I
I received the dreaded error: The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scalar Value.
error.
After some Googling, I found a suggestion to use: COUNTROWS( ).
Then, I was able to save the Measure without error, but it wouldn't work on my chart.MdxScript(Model) (4, 54) Calculation error in measure 'table'[Measure]: SummarizeColumns() and AddMissingItems() may not be used in this context.