Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello!
I am rather new here - and I am need your help.
I try to calculate a repair rate of products in the field.
I have one table with the sold products during the time.
I have another DateTime Dimension Table.
And I need one measure/table that shows how many products are in the market since that date.
It is nearly like the "Year to date" Funktion - but it should not start at 0 at the next periode....
(this should be the base for the following repair rate)
Would be great, if anyone can give me a hint!
Thx a lot!!!!
Elmar
Solved! Go to Solution.
Hi Elmar
I was not able to find a complete solution but might give you a hint nonetheless.
This formula in a new column basically does calculate what you're after (you might have to replace the semicolons with commas:
TotalSales = SUMX( FILTER( Sales; Sales[Date]<= EARLIER(Sales[Date]) && EARLIER(Sales[Type]) = Sales[Type] ); Sales[Sold Amount] )
I was not able to find a way to also display the values where it is blank now.
I hope this helps anyway...
JJ
Hi Elmar
I was not able to find a complete solution but might give you a hint nonetheless.
This formula in a new column basically does calculate what you're after (you might have to replace the semicolons with commas:
TotalSales = SUMX( FILTER( Sales; Sales[Date]<= EARLIER(Sales[Date]) && EARLIER(Sales[Type]) = Sales[Type] ); Sales[Sold Amount] )
I was not able to find a way to also display the values where it is blank now.
I hope this helps anyway...
JJ
Hello JJ!
Thank you very much - that realy helped me a lot.
Honestly - I don´t exactly understand, what the realy does - but it works. 😉
Best regards,
Elmar
Hi @Elmar_Z, sorry I skipped the explanation. As we are both German speakers I try to explain in Deutsch 🙂
SUMX() iteriert alle Einträge in der Tabelle welche FILTER() zurückgibt. FILTER() wiederum iteriert alle Einträge in der Sales-Tabelle und filtert diese mit der Bedingung, welche im zweiten Argument definiert ist.
Wir haben also 2 verschachtelte Iterationen. EARLIER() greift innerhalb der inneren Iteration (FILTER) auf die aktuelle Zeile der äusseren Iteration (SUMX) zu. Die Filterbedingung liest sich also: Liefere alle Einträge der Sales-Tabelle, welche ein Datum haben das früher / gleich ist wie das Datum der Zeile der äusseren Iteration. Zudem muss es vom gleichen Type sein.
Schlussendlich werden die Beträge so gefilterten Zeilen aufsummiert.
Ich hoffe, das war einigermassen verständllich....
Hallo @DoubleJ - danke für Deinen Nachtrag.
Ich bin in dem DAX Syntax und Denkweise einfach nicht fit. Aber ich lern dazu.... 😉
Beste Grüße und danke nochmals!
Elmar
User | Count |
---|---|
139 | |
113 | |
103 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |