Forum Discussion
Need help with a measure
McCow wrote:Shamatix all of your data has different values. whats must happen, if strings (records) with same seriennummer (Løbenummer) contains different VAT-values (Momsgrundlag)? Must be blank? And if same SN and same VAT-value must be printed (calculated as average value)? Correct?
Exactly!:)
try this and let me know pls if it work correct or no on yours data:
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 ||
AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]);
AVERAGE(Indfortoldning[Moms grundlag]);
BLANK()
)//if- Shamatix8 years agoPost Partisan
McCow wrote:try this and let me know pls if it work correct or no on yours data:
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); AVERAGE(Indfortoldning[Moms grundlag]); BLANK() )//ifThanks a ton for the help, almost there:
https://i.imgur.com/FVnYWXK.png
As you see on the above picture, it makes this one blank, eventho the momsgrundlag (vatamount) is the same
- McCow8 years agoResolver III
OK, Shamatix, you right, possible my mistake.
pls check this formula (based on previous):
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || // AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0; AVERAGE(Indfortoldning[Moms grundlag]); BLANK() )//ifMfG
- Shamatix8 years agoPost Partisan
McCow wrote:OK, Shamatix, you right, possible my mistake.
pls check this formula (based on previous):
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || // AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0; AVERAGE(Indfortoldning[Moms grundlag]); BLANK() )//ifMfG
McCow wrote:OK, Shamatix, you right, possible my mistake.
pls check this formula (based on previous):
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || // AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0; AVERAGE(Indfortoldning[Moms grundlag]); BLANK() )//ifMfG
Getting closer and closer:D
However this one turns up blank as well however here https://i.imgur.com/0XiOemi.png
it turns up blank as well (5 rows) same løbenummer and vatamount (moms grundlag)
- Shamatix8 years agoPost Partisan
- Shamatix8 years agoPost Partisan
McCow wrote:OK, Shamatix, you right, possible my mistake.
pls check this formula (based on previous):
MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || // AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0; AVERAGE(Indfortoldning[Moms grundlag]); BLANK() )//ifMfG
I really cant seem to figure out why its working correctly on some and not on some of the others.