# DAX Calculation help

Hello Team,

Am looking for logic where I need to calculate the Max Sales of the product in the current month, which I have able to get it, but when I map Channels in the Table the values are incorrect for the channels because of Filter Context, the channel values should be segregation of Total Maxvalue(561118) that is Pivot image attached.
Practise_Data.pbix (365.4 KB)

How do I fix this?

(Pivot image)

PBIX fie attached.

1 Like

@Dharma

``````MaxSales of Product =
MAXX (
SUMMARIZE (
Sales, Dates[Year], Dates[Date], Dates[Month Name], Sales[Channel]
),
"@Sales", [Total Sales]
),
[@Sales]
)
``````

.

``````MaxSales of Product 2 =
MAXX (
VALUES ( Sales[OrderDate] ),
[Total Sales]
)``````

@AntrikshSharma

Thank you for the Input but the solution is not working in my Table,

Let me Re-Iterate my queryâ€¦

1. I need to find out the Max sales of the product in a month wise, which I was able to figure out Example in August(2019) month - 561118 which came from â€śProduct 7â€ť.
2. Now I got the Max sales I need to find out how this max sales is divided among channel like you see in pivot image I was able to generate it but not in PBI Table.

I am not sure what you mean. How do we know what is your setup in Pivot Table?

Hello @Dharma, a gentle follow up on @AntrikshSharmaâ€™s question above.
Hope to hear back from you so we can help resolve your inquiry

Hello @Dharma, itâ€™s been a while since we got a response from you. In case there wonâ€™t be any activity on it in the next few days, weâ€™ll be tagging this post as Solved.

Dear @Dharma

You may try with the following measuresâ€¦ it is working out. I am attaching your pbix file with my workins :
Total Sales = SUM(Sales[Total Revenue])
RankXAllSelected = RANKX(ALLSELECTED(Products[Product Name]),[Total Sales])
Apply this RankXAllSelected in filter panel : is 1
Once it is done, you will get the top product as well as channel wise distribution as well.

Regards
S Uma
Dax_Calculation_help_maxvalue_based_on_product_Channel.pbix (368.4 KB)

1 Like

@UmaSuresh

Thank you so much, this is the exact solution I was looking for.