Forum Discussion

DYY94's avatar
DYY94
Helper I
3 years ago

Convert measure into a For loop with IF Condition

Hello Community, 

 

I want to to loop in this condition because it always gaves me '1' as a result.  

 

MR2 = 
Var mr365 = [MR/365] 
RETURN  
 IF ( mr365<1,1,mr365)
 
This is [MR/365] it's Measure: 
 

4 Replies

  • DYY94 , Try if this can help

     

    MR2 =
    Var mr365 = [MR/365]
    RETURN
    Sumx(Values(Table[Maturire]) , IF ( mr365<1,1,mr365))

     

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi DYY94 ,

     

    Since I don't know how your [MR/365] metric was created, in the sample file on my side, it seems to be fine.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.