Forum Discussion
Daily max calculation, by months
Hi,
I have a problem with calculating max daily sum. Somehow it calculates it monthly. Here's how it looks like:
I have tried with solution from this topic:
And can't get diffrent result than simple monthly sum.
Hi blazko,
In the given thread, the week column and Amount are in one table. While based on your DAX formula, your data and value in different table. You want to create a measure or calculated column? What do your resource table look like?
Based on my understanding, you'd better get the amount in 'relacje_data' table using the formula:
amount=SUM(RELATED(tabela_linie[amount]))
Then create a measure use the formula bolow.result=MAXX(SUMMARIZE(relacje_data,relacje_data[Date].[day]),"Amount",SUM(relacje_data[amount])),[Amount])
Finally, you can create a table visual, add the relacje_data[Date] and [result] as value fields.
Best Regards,
Angelia
5 Replies
- v-huizhn-msft
Microsoft Employee
Hi blazko,
In the given thread, the week column and Amount are in one table. While based on your DAX formula, your data and value in different table. You want to create a measure or calculated column? What do your resource table look like?
Based on my understanding, you'd better get the amount in 'relacje_data' table using the formula:
amount=SUM(RELATED(tabela_linie[amount]))
Then create a measure use the formula bolow.result=MAXX(SUMMARIZE(relacje_data,relacje_data[Date].[day]),"Amount",SUM(relacje_data[amount])),[Amount])
Finally, you can create a table visual, add the relacje_data[Date] and [result] as value fields.
Best Regards,
Angelia- blazko
Helper III
Hi, thank You for your response, but I'm not quite getting this one:
Based on my understanding, you'd better get the amount in 'relacje_data' table using the formula:
amount=SUM(RELATED(tabela_linie[amount]))
Yes these are two separate tables. Is this: amount=SUM(RELATED(tabela_linie[amount])) a measure? Can't do SUM(RELATED...Instead of 'RELATED' it wants me to give a certain table
- v-huizhn-msft
Microsoft Employee
Hi blazko,
amount=SUM(RELATED(tabela_linie[amount])) a calculated column. My purpose is that leat the amount and data in sample table. Based on my understanding, there might be mutiple amount record for each date, so I use sum() function. If the amount is single, you can just use RELATED(tabela_linie[amount]). Related function is used to another related table.
Besides, you can post sample table if you still have problem. I really understand your data is private. You can create simple similar data like yours. So that I can post solution closed to your requirement.
Thanks,
Angelia
- blazko
Helper III
finally got it. Thanks :)
- cjulianm
Advocate I
Hi Angelia
I think you have a ) in the wrong place here - after .[day]. Should be:
result=MAXX(SUMMARIZE(relacje_data,relacje_data[Date].[day],"Amount",SUM(relacje_data[amount])),[Amount])
Regards
Julian