Forum Discussion

RRaj_293's avatar
RRaj_293
Icon for Helper III rankHelper III
3 years ago
Solved

Dax Help - Min and Max

Hi ,    Scenario- I have a Line Table (A in below pic) which has different orders and their lines for which certain number of days field is calculated. It has negative and positive numbers. The var...
  • parry2k's avatar
    3 years ago

    RRaj_293 try this measure: but you have to turn on show items with no data because when you are returning BLANK () where the

    No of Days Measure = 
    VAR __MaxDays = MAXX ( Orders, [No of Days] )
    VAR __MinDays = MINX ( Orders, [No of Days] )
    VAR __CountBlank = COUNTROWS ( FILTER ( Orders, ISBLANK ( [No of Days] ) ) )
    RETURN
    IF ( __CountBlank >= 1, BLANK (), IF ( __MinDays < 0, __MinDays, __MaxDays ) ) 

     

    Tweak the above measure as you see fit, as I didn't understand the full logic.

     

     

    order has a blank number of days by default any visual will suppress that rows: