Forum Discussion
Quickly DAX measure fix - Filter
- 6 years ago
hej pawelj795
W pliku ktory wyslales nie bylo tego obiektu wiec musiale go wylachys z formuly.
Zalaczylem plik z formua.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Mariusz
Dostaje błąd: "The end of the input was reached"
Dlaczego YTD wylaczyles z formuly?
hej pawelj795
W pliku ktory wyslales nie bylo tego obiektu wiec musiale go wylachys z formuly.
Zalaczylem plik z formua.
Mariusz
If this post helps, then please consider Accepting it as the solution.
- pawelj7956 years ago
Post Prodigy
Dokładnie o to mi chodziło 😉
Bardzo ci dziękuje za pomoc i wesołych świąt !- pawelj7956 years ago
Post Prodigy
Mariusz
Witam w nowym roku 🙂
Potrzebuje jednej drobnej rzeczy do stworzonej przez ciebie formuly.Mianowicie chciałbym stworzyć tabelę, w której oprócz ItemID i wartości będzie data ostatniej transakcji na danym itemie.
Oczywiście wszelkie filtry, które były używane do wyliczenia wartości zostaną.
Próbowałem sam stworzyć tą miarę w banalny sposób, tzn. wycięcia z twojej formuły z wartością, fragmentu z datą, ale nic mi to nie przyniosło.
- pawelj7956 years ago
Post Prodigy
Mariusz
Cześć,
Musze niestety odkopać temat, bo pojawił się problem od startu nowego roku.
Formuła nierozpoznaje dni z poprzedniego roku, jako, że w sumie użyte było DATESYTD.
Aktualnie pokazuje tylko wiekowanie na 0-15 dni i to też niepoprawnie, bo pokazuje wartosc - 14 tysięcy
Byłbym bardzo wdzięczny, jak mogłbyś mi z tym pomóc 🙂- Mariusz6 years ago
Community Champion
Hi pawelj795
You can add an extra variable __date and later use it as the third argument of CALCULATE, there are three extra lines followed by "--new" in the code, this is to replace DATESYTD.
Please see the below for reference.M = VAR __tbl = FILTER( GROUPBY( CALCULATETABLE( WH_Invent_Trans, KEEPFILTERS( WH_Invent_Trans[TransType] IN { 0, 9 } ), KEEPFILTERS( WH_Invent_Trans[QTY] <> BLANK() ), ALLEXCEPT( WH_Invent_Trans, WH_Invent_Trans[ItemID] ) ), WH_Invent_Trans[ItemID], "@maxDate", MAXX( CURRENTGROUP(), WH_Invent_Trans[DatePhysical] ) ), VAR __days = DATEDIFF( [@maxDate], TODAY() -1, DAY ) RETURN __days > 0 && __days <= 276 --changed as 15 was out of range ) VAR __date = MAX( DimDates[Date] ) -- new RETURN CALCULATE( SUM( WH_Invent_Trans[Inventory Value EUR] ), TREATAS( SUMMARIZE( __tbl, WH_Invent_Trans[ItemID] ), WH_Invent_Trans[ItemID] ), DimDates[Date] <= __date, -- new ALL( DimDates ) -- new )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.