Forum Discussion
Sofinobi
Helper IV
3 years agoSummarized table from two tables
hello community please if you can help me, i have 2 tables : Product and Date i want to create a summarized table that have a column from Product table (Product) and the (Month year from Date Tabl...
- 3 years ago
never use SUMMARIZE to add columns!
OverStock Table = ADDCOLUMNS(SUMMARIZE(Sales_Tab,'Product'[Product],'Date'[Month Year]),"AVG Stock",'Measure'[AVG Stock Qte Month],"AVG Sales Qte R3M",'Measure'[AVG Sales Qte R3M],"AVG Price",'Measure'[AVG Price Month]) - 3 years ago
GENERATE ( SUMMARIZE ( 'Sales_Tab', 'Product'[Product] ), ADDCOLUMNS ( SUMMARIZE ( 'Date', 'Date'[Month Year], 'Date'[YearMonth Number] ), "Avg Stock", VAR _date = CALCULATE ( MAX ( 'Date'[Date] ) ) VAR _mon = FORMAT ( MAXX ( FILTER ( ALL ( 'Date'[Date] ), [AVG Stock Qte Month] && 'Date'[Date] <= _date ), 'Date'[Date] ), "mmm yy" ) RETURN CALCULATE ( 'Measure'[AVG Stock Qte Month], 'Date'[Month Year] = _mon, REMOVEFILTERS('Date') ) ) )
Sofinobi
Helper IV
3 years agohi all,
finnaly i find a sollution for my table, two expressions give the correct values but it still one expression doesn't show any value
do you have any idea what is the problem?
average3.pbix
thank you
- DimaMD3 years ago
Solution Sage
Hi Sofinobi I faced the same problem solving your problem. Let's try to figure out what is wrong with you.
What do you want to see the correct total when you calculate ( [AVG Stock Qte Month]-[AVG Sales Qte Month] ) * [AVG Price month],
Can you provide your expected result?