Forum Discussion

Dunner2020's avatar
Dunner2020
Post Prodigy
5 years ago

Measure for card visual

Hi there,

 

I have calculated the measure that returns the  faliure of an event if the event faliure value is more than some predefined value (let say 3) and the failure of event happened before on the same location, due to same cause, and on the same equipment . Here is my measure:

Failure value =

Var _cause = MAX( 'Fact'[Cause] )
Var _loc = MAX( 'Fact[CircuitID] )
Var _equip = MAX( 'Fact'[Equipment] )
Var _zone = MAX('Fact'[Substation])
Var _mindate = EDATE(EOMONTH(TODAY(),0),-[N Value])
var _count = CALCULATE(DISTINCTCOUNT('Fact'[EventID]),FILTER('Fact','Fact'[CircuitID] ==_loc && 'Fact'[Cause] == _cause &&'Fact'[Substation] == _zone && 'Fact'[Actual Event Start Time (NZST)]>=_mindate))
Return

IF(_count>[Trigger Value Value],_count)
 
The above measure returns the desired value when I used in the table visual. When I tried to use in the card visual, it returns blank. I think the reason for return blank is because context is missing in the card visual. I wanted to create a measure that returns the total value of such incidents (that are coded above) without referring to context. Any help would be really appreciated.

3 Replies

  • Dunner2020 , to get total. Change the return like below and check 

     

    Return

    Sumx(addcolumns(Summarize( Fact, [Cause],[CircuitID],[Equipment],[Substation]), "_1", IF(_count>[Trigger Value Value],_count) ), [_1])

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Dunner2020 ,

     

    I think I could understand what's your expected. But actually you only provided some measures but no data samples, which is not enough for me to solve the problem quickly.

     

    So please provide me with more details about your table or share me with your pbix file after removing sensitive data to help us clarify your scenario.

     

    Best Regards,
    Eyelyn Qin