Forum Discussion
Help with measure
I have two true/false columns in my data:
SCHEDULE_ACTIVE
SCHEDULE_ACHIEVED
I have created measures to countrows where each is TRUE to get a 1 or a null value.
However, for Schedule Achieved, I want it to give me a 0 value if Schedule Active for that row is TRUE so it's really clear when the Schedule has NOT been Achieved. I also need this to create conditional icons.
I tried some DAX but it's not working.
What i'm trying say is:
If SCHEDULE_ACTIVE is TRUE, then 1 else 0
then countrows of SCHEDULE_ACHIEVED = TRUE if SCHEDULE_ACTIVE is 1, else 0
Then I would hope the result is:
1 for Schedule Active = TRUE + schedule achieved = TRUE
0 for Schedule Active = TRUE + Schedule Achieved = FALSE
null for Schedule Active = FALSE + Schedule Achieved = FALSE
This is my DAX, please can you help me?
Schedule Items Achieved =
VAR Schedule_Active = SUMX('Schedule of Services', IF ('Schedule of Services'[SCHEDULE_ACTIVE]=TRUE(), 1, 0 ) )
VAR Schedule_Achieved = CALCULATE(COUNTROWS('Schedule of Services'), 'Schedule of Services'[SCHEDULE_ACHIEVED]=TRUE() )
RETURN
CALCULATE ( Schedule_Achieved , IF ( Schedule_Active = 1 , 0 ) )
As I got no response to this I created a case when statement in the sql to override the true false column with the values I needed
1 Reply
- JemmaDHelper V
As I got no response to this I created a case when statement in the sql to override the true false column with the values I needed