cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

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.

Users Online
Currently online: 6 members 1,730 guests
Please welcome our newest community members: