Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Elmar_Z
Regular Visitor

Aggregation items in the field

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.

 

sold.JPG

 

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)

 

aggregation_table.JPG

 

Would be great, if anyone can give me a hint!

 

Thx a lot!!!!

Elmar

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
DoubleJ
Solution Supplier
Solution Supplier

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]
)

Aggregation_01.PNG

I was not able to find a way to also display the values where it is blank now. 

 

I hope this helps anyway...

JJ

 

 

 

View solution in original post

4 REPLIES 4
DoubleJ
Solution Supplier
Solution Supplier

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]
)

Aggregation_01.PNG

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 

 

amount of products in the market during the timeamount of products in the market during the time

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.