Forum Discussion

manojk_pbi's avatar
manojk_pbi
Helper V
1 year ago
Solved

Filter Value based on the previous month

Hi ,

I tried with many options using the references but could not succed.

I have single table having budget and forecast values defined for entire year. I would like present the previuos months budget in a card for the current month. I am not able to get the proper measure. The number should change if any other dimensions selected from the same table. Expecting the measure should display Jul data.

1/1/202517.904377
2/1/202523.78735597
3/1/202552.4587239
4/1/202582.80433085
5/1/2025106.7567672
6/1/2025119.5485513
7/1/2025177.8264148
8/1/2025342.5431403
9/1/2025373.3442172
10/1/2025379.1886683
11/1/2025654.981763
12/1/2025746.7441488
  • manojk_pbi So like this?

    Previous Month's Budget =
      VAR __Month = MONTH( TODAY() )
      VAR __Year = YEAR( TODAY() )
      VAR __Date = DATE( __Year, __Month, 1 )
      VAR __Result = MAXX( FILTER( ALL( 'Table' ), [Date] = __Date ), [Budget] )
    RETURN
      __Result

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    manojk_pbi So like this?

    Previous Month's Budget =
      VAR __Month = MONTH( TODAY() )
      VAR __Year = YEAR( TODAY() )
      VAR __Date = DATE( __Year, __Month, 1 )
      VAR __Result = MAXX( FILTER( ALL( 'Table' ), [Date] = __Date ), [Budget] )
    RETURN
      __Result
  • v-lgarikapat's avatar
    v-lgarikapat
    Community Support

    Hi manojk_pbi , 

    Thanks for reaching out to the Microsoft fabric community forum.

    Greg_Deckler  , 

    Thanks for your prompt response

    manojk_pbi 

    I wanted to follow up and confirm whether you’ve had a chance to review the information  shared by Greg_Deckler  If you have any questions or need further clarification, please don’t hesitate to reach out.

    If you're still encountering any challenges, feel free to let us know we’d be glad to assist you further.

    Looking forward to your response.

    Best regards,
    Lakshmi

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

      Hi manojk_pbi ,

       

      We haven’t heard back from you regarding our last response, so I just wanted to check in to see if you were able to resolve the issue. If you have any further questions or need assistance, please feel free to let us know.

      Best Regards,

      Lakshmi