Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jackypatel
Helper I
Helper I

Need Last Month Data in My Card View

I have a calender that contain April is the starung Month & March is the Last Month of the year. For Example i have data like Month & Return as mention below

 

MonthReturn
Apr-2353690
May-2354402
Jun-2340245
Jul-2352303
Aug-2334513
Sep-2351151
Oct-2344559
Nov-2350948
Dec-2369529
Jan-2461732
Feb-2453498
Mar-2453498
Apr-2453690
May-2454402
Jun-2440245
Jul-2452303
Aug-2434513
Sep-2451151
Oct-2444559
Nov-2450948
Dec-2469529
Jan-251732
Feb-253098
Mar-25 

 

Also I Have Year Filter 2023-24 & 2024-25

Now If i select 2023-24 than data should be Mar-24 Return (53498) & If i Select 2024-25 than Feb-25 Return (3098).

 

And I Add add data Of Mar-25 in next Month so 2024-25 Return Value Should be Mar-25 (Data)

 

Plz help me.

10 REPLIES 10
v-menakakota
Community Support
Community Support

Hi @jackypatel ,

I hope the provided  information by @PijushRoy  is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution so others can find it easily.

Thank you.

Hi @jackypatel ,

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.

 

Hi  @jackypatel  ,

I would also take a moment to thank @PijushRoy  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 

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 the  response has addressed your query, please accept it as a solution so that other community members can find it easily. 

 
Thank you. 

 

PijushRoy
Super User
Super User

Hi @jackypatel 

Please find the solution, attached PBIX

PijushRoy_3-1742324738660.png

Please check the two calculated column in PBIX file

 



Measure = VAR _LatestMonth = IF(SELECTEDVALUE('Table'[Return])=0,MAX('Table'[Fiscal_Month_No])-1,MAX('Table'[Fiscal_Month_No]))
RETURN
CALCULATE(SUM('Table'[Return]),'Table'[Fiscal_Month_No]=_LatestMonth)

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Thanx for you support, But Its Not Working. If i added Mar-25 Data than it is also Showing Feb-25 Data.

 

Plz guide us further 

Hi @jackypatel 
I have check with Feb 2025 data and without data, now working.
Please use the measure in same PBIX file

Latest Month Return = 
VAR SelectedYear = SELECTEDVALUE('Table'[Year]) 
VAR MaxMonthNo =
    CALCULATE(
        MAX('Table'[Fiscal_Month_No]), 
        FILTER('Table', 'Table'[Year] = SelectedYear)
    )
VAR LatestMonthReturn =
    CALCULATE(
        MAX('Table'[Return]),
        FILTER('Table', 'Table'[Fiscal_Month_No] = MaxMonthNo && 'Table'[Year] = SelectedYear)
    )
VAR PreviousMonthReturn =
    CALCULATE(
        MAX('Table'[Return]), 
        FILTER('Table', 'Table'[Fiscal_Month_No] = MaxMonthNo - 1 && 'Table'[Year] = SelectedYear)
    )
RETURN
    IF(
        ISBLANK(LatestMonthReturn), 
        PreviousMonthReturn, 
        LatestMonthReturn 
    )



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Thank you... Your Dax is working.

 

But in my Dax is not Showing the value. Because Calender (Date) & Return Value is different  file. 

 

So what shoud i do for this???

jackypatel_0-1742382592495.png

Kindly Help

 

Hi @jackypatel 
You can create a relationship between Table and Calendar with a Date column (if you have one) or else Fiscal Month no column (I can see the column available in your data).

The use the DAX 

Latest Month Return = 
VAR SelectedYear = SELECTEDVALUE('Calendar'[Year]) 
VAR MaxMonthNo =
    CALCULATE(
        MAX(' Calendar '[Fiscal_Month_No]), 
        FILTER(' Calendar', ' Calendar '[Year] = SelectedYear)
    )
VAR LatestMonthReturn =
    CALCULATE(
        MAX('Table'[Return]),
        FILTER(' Calendar ', ' Calendar '[Fiscal_Month_No] = MaxMonthNo && ' Calendar'[Year] = SelectedYear)
    )
VAR PreviousMonthReturn =
    CALCULATE(
        MAX('Table'[Return]), 
        FILTER(' Calendar', ' Calendar'[Fiscal_Month_No] = MaxMonthNo - 1 && ' Calendar'[Year] = SelectedYear)
    )
RETURN
    IF(
        ISBLANK(LatestMonthReturn), 
        PreviousMonthReturn, 
        LatestMonthReturn 
    )


If not work, Please attached PBIX file link 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Tutu_in_YYC
Super User
Super User

Before you try to get the last month calculation, you will need a fiscal date, bbecause your start date is not jan.

Have a look at how to set one up.
https://pragmaticworks.com/blog/dynamic-fiscal-year-date-table-using-dax-in-power-bi.

Then for the last month measure, you can just create a calculation using time intelligence or some manipulation of filter context.

Share a pbix if you can.

i am unable to attached the File. Data is already There.

 

 

Plz help

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.