Forum Discussion
Comparing TEXT vs INT not allowed.. but I'm using FORMAT!!
Hi!! obtain an error comparing "TEXT" vs "INT", but I'm using FORMAT too, I don't understand. I want this measure returns weighted average by date,,, ideas? Thanks you!
My measure is:
Weighted Average by Date =
FORMAT(
SUMX(
FILTER(MOVIGRANJ, MOVIGRANJ[MovementType] = 3 & MOVIGRANJ[ArticleType] = 1),
MOVIGRANJ[Date].[Date]*MOVIGRANJ[AnimalsNumber]/MOVIGRANJ[AnimalsNumber]),
"General Date")
Thanks in advance
jrscaletta
You can useWeighted Averaged Date Movement type 1 = FORMAT ( SUMX ( FILTER ( Hoja1, Hoja1[MovementType] = 1 && Hoja1[ArticleType] = 1 ), Hoja1[Date] * Hoja1[AnimalsNumber] ) / [AnimalsMovementType1], "General Date" )
10 Replies
- tamerj1
Community Champion
Hi jrscaletta
A small mistake - jrscaletta
Helper II
Thnanks you very much! Now it works, but the result isn't correct, I obtain date "10/8/2143", when my most recent date is "02/05/2022"...
Ideas? Thanks
- tamerj1
Community Champion
What are you trying to calculate?
- jrscaletta
Helper II
Hi tamerj1!! Thanks for your reply!
I want to calculte the average date ponderated by AnimalsNum with criteria.
All my movements are on the MOVIGRANJ table (date too).
I have 4 important fields for this:
- DATE (Date)- NUM ANIMALS (Integer)
- MOVEMENTTYPE (Integer)
- ARTICLETYPE -or product- (Integer)
- FARM (integer)
I need to calculate the average date ponderated by AnimalsNum with criteria on fields "MOVEMENTTYPE = 3" and "ARTICLETYPE = 1".