Forum Discussion

Jainaba's avatar
Jainaba
Frequent Visitor
7 years ago
Solved

if measure based on different row

Hello all, in need help with a measue 

I am trying to get a number based on another number that is tied to a difffrent code that i have relatioships to.

I have a fact table that and created lots of measurments. all the measuments work if im doing a a relationship with many to many filtering both ways, exept this one. 

 

If i change the relationship to filter the fact table to my data base the other measures do not give the correct number but this one does. 

Which leaves me to belive i need to work on this measure. 

 

here is how i have it written. 

#2 Hang Tend = if( CONTAINS('Fact Table','Fact Table'[Item Name],"tend"),
CALCULATE(
CALCULATE((sum(PDSSN[PIECE_CNT])/2),PDSSN[YLD_GROUP] in {2030})
-
CALCULATE(Sum(PDSSN[PIECE_CNT]),PDSSN[YLD_GROUP] in{4098})
))
 
I have been trying to figure this out for days any help on this would be greatly appricated!!!
  • I figured it out what i was missing was the cross filter 

     

     


    Jainaba wrote:

    Hello all, in need help with a measue 

    I am trying to get a number based on another number that is tied to a difffrent code that i have relatioships to.

    I have a fact table that and created lots of measurments. all the measuments work if im doing a a relationship with many to many filtering both ways, exept this one. 

     

    If i change the relationship to filter the fact table to my data base the other measures do not give the correct number but this one does. 

    Which leaves me to belive i need to work on this measure. 

     

    here is how i have it written. 

    #2 Hang Tend = if( CONTAINS('Fact Table','Fact Table'[Item Name],"tend"),
    CALCULATE(
    CALCULATE((sum(PDSSN[PIECE_CNT])/2),PDSSN[YLD_GROUP] in {2030})
    -
    CALCULATE(Sum(PDSSN[PIECE_CNT]),PDSSN[YLD_GROUP] in{4098})
    ))
     
    I have been trying to figure this out for days any help on this would be greatly appricated!!!


     

2 Replies

  • Jainaba's avatar
    Jainaba
    Frequent Visitor

    I figured it out what i was missing was the cross filter 

     

     


    Jainaba wrote:

    Hello all, in need help with a measue 

    I am trying to get a number based on another number that is tied to a difffrent code that i have relatioships to.

    I have a fact table that and created lots of measurments. all the measuments work if im doing a a relationship with many to many filtering both ways, exept this one. 

     

    If i change the relationship to filter the fact table to my data base the other measures do not give the correct number but this one does. 

    Which leaves me to belive i need to work on this measure. 

     

    here is how i have it written. 

    #2 Hang Tend = if( CONTAINS('Fact Table','Fact Table'[Item Name],"tend"),
    CALCULATE(
    CALCULATE((sum(PDSSN[PIECE_CNT])/2),PDSSN[YLD_GROUP] in {2030})
    -
    CALCULATE(Sum(PDSSN[PIECE_CNT]),PDSSN[YLD_GROUP] in{4098})
    ))
     
    I have been trying to figure this out for days any help on this would be greatly appricated!!!