cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Elmar_Z Frequent Visitor
Frequent 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

Accepted Solutions
DoubleJ Member
Member

Re: Aggregation items in the field

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 Member
Member

Re: Aggregation items in the field

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

Elmar_Z Frequent Visitor
Frequent Visitor

Re: Aggregation items in the field

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 

 

result.JPGamount of products in the market during the time

DoubleJ Member
Member

Re: Aggregation items in the field

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....

Elmar_Z Frequent Visitor
Frequent Visitor

Re: Aggregation items in the field

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
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 245 members 2,521 guests
Please welcome our newest community members: