Forum Discussion

EricoVincentciu's avatar
1 year ago
Solved

year and month dynamic selection

i wanna make snapshoot from power bi fabric to email like this : 

 

 

but i got issue, 

 

 

i can't make period as dynamic,

 

first i must open this file dashboard

 

second i select current month year

 

and it's not the goal form this project

how to make filter 'period' automatic selected current month and year ??

 

and not trigger by human

 

thank you 

 

nilendraFabric  NandanHegde suparnababu8 AndyDDC 

  • v-karpurapud's avatar
    v-karpurapud
    1 year ago

    Hi EricoVincentciu 

    To dynamically filter your Power BI report to always reflect the current month and year,


    Add a calculated column in the date table:

    IsCurrentMonth = IF(YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) = MONTH(TODAY()), TRUE(), FALSE()).

    Then, in Power BI Desktop, apply a page or report-level filter: Set IsCurrentMonth = TRUE. This ensures that the report always filters to the current month automatically.

     In Power Automate, use the "Export To File for Power BI Reports" action. Since the report is already filtered, it will export the current month view without needing any manual slicer selection. This fully automates your snapshot and emailing process based on the current month and year.

     

    If this post is helpful, kindly mark it as the accepted solution.

    Thank You!

7 Replies

    • EricoVincentciu's avatar
      EricoVincentciu
      Helper II

      it's good but i wanna make it automate click by schaduler or power apps, is it possible ??

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

    Hello EricoVincentciu 

    Thank you for reaching out to the Microsoft Community Forum regarding year and month dynamic selection.

     

    Yes, it is possible to automate the selection of the current month and year in your Power BI report without manual intervention.

    To get an automated email with a snapshot of the report, use Power Automate with Power BI.

     

    1. Create a scheduled automation in Power Automate to run at a specific time (e.g., daily or monthly), and use the "Export Power BI Report to File" action to generate a snapshot.
       
    2. Select the appropriate Workspace, Report, and Export Format, and apply a dynamic filter to ensure the report always reflects the current month and year automatically.
       
    3. Add an email action in Power Automate to send the exported report file to recipients, define the recipient list, subject, and email body, attach the report, and ensure the automation runs as scheduled.

    If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

    Additionally, thank you NandanHegde for responding on this issue.

    Thank you.

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

    Hi EricoVincentciu 

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

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

    Hi EricoVincentciu 

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

    Thank you.

    • EricoVincentciu's avatar
      EricoVincentciu
      Helper II

       

       

      currently in my time zone this is april month, base on logic this must be april not march i don't wanna change it by manual tick by human this is must be automate by schaduler 

       

       

      this is column what i use to create month and year

       

       

      let
          Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKikqTVWK1YlWSkvMKQayYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [flag = _t]),
          #"Changed Type" = Table.TransformColumnTypes(Source,{{"flag", type logical}})
      in
          #"Changed Type"

       

      Year Month Slicer = 
      
      IF (
          YEAR(TODAY()) = YEAR('Date (4)'[Date]) && MONTH(TODAY()) = MONTH('Date (4)'[Date]),
          FORMAT(TODAY(), "yyyy - mmmm"),
          'Date (4)'[Year & Month]
      )
      preselected_value = MAX('Date (4)'[Year_month_Code]) = YEAR(TODAY())*100 + MONTH(TODAY())

       

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

        Hi EricoVincentciu 

        To dynamically filter your Power BI report to always reflect the current month and year,


        Add a calculated column in the date table:

        IsCurrentMonth = IF(YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) = MONTH(TODAY()), TRUE(), FALSE()).

        Then, in Power BI Desktop, apply a page or report-level filter: Set IsCurrentMonth = TRUE. This ensures that the report always filters to the current month automatically.

         In Power Automate, use the "Export To File for Power BI Reports" action. Since the report is already filtered, it will export the current month view without needing any manual slicer selection. This fully automates your snapshot and emailing process based on the current month and year.

         

        If this post is helpful, kindly mark it as the accepted solution.

        Thank You!