periodToDateSumOverTime function for one category

I have a measure that contains information about the amount of purchases. This variable contains information from different countries (I have a country field). I want to use the periodToDateSumOverTime function in order to sum the purchases from a certain country over a period of time. I want to use this field in a graph together with additional data that refer to all the countries, so I cannot filter the entire graph.
I tried to use the ifelse function together with the periodToDateSumOverTime function but I got an error - mismatched aggregation.
How can this be done?

This might sum it too many times, but you can add a nested sumOver the country.

periodToDateSumOverTime(sumOver(sum({metric}),[{country}]), {date}, MONTH)

Hi @PninaBarak ,

Could you provide additional details of the error message and screenshot of your calculation and the visual?