Hello,
I found a solution to this problem…I created a visual showing the total lines in the dataset.
then I created a parameters in the visual that the viewer can modify inserting the numbers displayed in that visual and I put this parameter where there is XXXX in the previous form.
It is not super convenient but it is a way to overcome the aggregation problems