web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Export to file for pag...
Power Automate
Answered

Export to file for paginated report generating email only if there is data to view

(0) ShareShare
ReportReport
Posted on by 10

Hi to all,

 

I work daily with Power BI and i have to create an Schedule Flow to extract data from a dataset (Paginated report) and send to a list of users.

 

This email is sent with the "Apply to each", and everything is working fine, but i want to only send to the user that have data to see and don't send emails with blank tables.

 

I tried to create a query against a dataset but didn't have success with this measure:

 

 

COALESCE(
CALCULATE(
COUNTROWS(DataTable),
'Name-ID'[Name] = "@{variables('Name')}",
'Calendar'[Month (Year)] = "@{variables('LastMonth')}"
),
0)

 

 

It returns: 

{"statusCode":"OK","headers":{}}

 And i wanted to see the number of rows and if it was more than 0, then send the email.

 

Any suggestions?

Categories:
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    In the next action you are supposed to consume the result of the DAX query. That query result will be a table (in your case a single row single column table).   You can use a Select action to harvest that result and then use it in your next decisions.

     

    Note:  Your query is missing the EVALUATE ROW("Column Name",...  prefix.

     

    lbendlin_0-1665014593758.png

     

  • SergioSilvaDVS Profile Picture
    10 on at

    Hi @lbendlin 

     

    Thanks for the quick reply.

     

    I have the Evaluate in the DAX query, but doesn't return the measure result.

     

    i always get :

    {"statusCode":"OK","headers":{}}

     I know that the measure works because i tested it in the dataset and returns the value that i need.

     

    Thanks in advance,

    Sérgio Silva

  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    Please show a sanitized version of your full query.

  • SergioSilvaDVS Profile Picture
    10 on at

    I solved with another solution, thanks for all the help.

  • SergioSilvaDVS Profile Picture
    10 on at

    After all, the other solution is not a solution and I will have to be able to make this query via Power Automate.

     

    My query is the following:

    SergioSilvaDVS_0-1665496748818.png

     

    Then in the condition formula i do the following:

    SergioSilvaDVS_1-1665496786506.png

     

    The result from the formula is 

    {"statusCode":"OK","headers":{}}

    And always gives false!

     

    Thanks in advance.

  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    EVALUATE needs to return a table.  You are trying to return a scalar value.

     

    use EVALUATE ROW(...)  instead.  That will return a single column single row table that you can then iterate over once.

  • SergioSilvaDVS Profile Picture
    10 on at

    I get the same result with EVALUATE ROW(...), what do I need to do to get the result into a variable?

  • Verified answer
    lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    lbendlin_0-1665516792832.png

    or shorter

    lbendlin_1-1665516863261.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#2
Henil Profile Picture

Henil 128

#3
anirudhev Profile Picture

anirudhev 124

Last 30 days Overall leaderboard