Forum Discussion

Phylicia's avatar
Phylicia
Regular Visitor
1 year ago
Solved

Dynamic subscription with multiple parameter value

Dear all,

 

I am creating a paginated report using existing semantic model, and I want to distribute the subscription to different users with different selected country information. I have a paratemer called country and my paginated report query is:

 

EVALUATE
SUMMARIZECOLUMNS(

Sales[Sales amount],

Sales[Country],

 

Filter(Sales,

CONTAINSSTRING(@country,Sales[Country])

)

 

For now I have a semantic model contains my parameter information like:

EmailCountry
[email protected]US
[email protected]CA

 

But I found in this way, the user will receive 2 emails, one is with US data and the other is with CA data.

 

I would like to send the user all selected country data in one email.

 

For example,

EmailCountry
[email protected]US, CA

 

Could anyone give me any suggestions on it?

 

Thank you so much.

  • Hi Phylicia,

    Thank you Akash_Varuna for the solution you provided.

     

    I appreciate the detailed explanation of your scenario. The issue occurs because your dynamic subscription parameter table includes multiple rows for each user, which leads Power BI to send separate report emails for every row.

    To address this, I suggest consolidating the countries for each user into a single row by concatenating the country values (for example, "US,CA"). This ensures each email address appears only once, and the @country parameter will return all relevant data in one report.

    Here is an example of the aggregated table format:

    Email           | Country

    [email protected]   | US, CA

    With this approach, you can use the new table for your dynamic subscription, and your existing CONTAINSSTRING(@country, Sales[Country]) logic will continue to function as intended.

     

    Thanks for reaching out! If this answer was helpful, please consider marking it as Accepted Solution and giving a Kudos, it helps the community!

     

    Regards,
    Sahasra.

5 Replies

  • Hi Phylicia preprocess your semantic model to combine multiple countries for each user into one row (e.g., US, CA). Update the paginated report query to handle multiple countries by splitting the parameter dynamically and filtering the data (e.g., using IN logic).

    EVALUATE
    SUMMARIZECOLUMNS(
        Sales[Sales amount],
        Sales[Country],
        FILTER(
            Sales,
            Sales[Country] IN {"US", "CA"}
        )
    )

    Pass the combined Country string (e.g., US, CA) as a single parameter.

    VAR SelectedCountries = SPLIT(@country, ", ")
    RETURN
    FILTER(Sales, Sales[Country] IN SelectedCountries)
  • v-sgandrathi's avatar
    v-sgandrathi
    Community Support

    Hi Phylicia,

    Thank you Akash_Varuna for the solution you provided.

     

    I appreciate the detailed explanation of your scenario. The issue occurs because your dynamic subscription parameter table includes multiple rows for each user, which leads Power BI to send separate report emails for every row.

    To address this, I suggest consolidating the countries for each user into a single row by concatenating the country values (for example, "US,CA"). This ensures each email address appears only once, and the @country parameter will return all relevant data in one report.

    Here is an example of the aggregated table format:

    Email           | Country

    [email protected]   | US, CA

    With this approach, you can use the new table for your dynamic subscription, and your existing CONTAINSSTRING(@country, Sales[Country]) logic will continue to function as intended.

     

    Thanks for reaching out! If this answer was helpful, please consider marking it as Accepted Solution and giving a Kudos, it helps the community!

     

    Regards,
    Sahasra.

    • v-sgandrathi's avatar
      v-sgandrathi
      Community Support

      Hi Phylicia,

       

      We wanted to check if you had a chance to review our last reply. Let us know if it helped or if you need more guidance—we're always happy to help further.

      If the solution worked for you, please click Accept as Solution and feel free to leave a Kudos for visibility.

      Looking forward to hearing from you!

       

      Thank  you.

      • v-sgandrathi's avatar
        v-sgandrathi
        Community Support

        Hi Phylicia,

         

        We wanted to follow up to see if our suggestion was helpful. Please let us know how things are progressing and if you are still encountering any issues.

        If the response resolved your problem, you may mark it as the solution and give it a thumbs up to assist others in the community as well.

         

        Thank you.