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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to get last month value in Total Column

Hi Team

 

I have a data where I am showing my data like below

RatanBhushan_0-1628061288568.png

RatanBhushan_1-1628061333837.png

data sample -

RatanBhushan_2-1628061363575.png

 

If we keep filter of months and we select filters upto last reporting month like Jan2021 to Jul2021 -so YTD Total should show Jul2021 values?

Is there any way to get last month data in TOTAL Column?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Last month data or or YTD till last month

 

 

last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd("Date"[Date],-1,MONTH)))


YTD QTY forced=
var _max = eomonth(today(),-1)
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)

 

You can use isinscope to switch total

if(not(isinscope(Date[Month Year])), [Meausre],[last MTD Sales])

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Last month data or or YTD till last month

 

 

last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd("Date"[Date],-1,MONTH)))


YTD QTY forced=
var _max = eomonth(today(),-1)
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)

 

You can use isinscope to switch total

if(not(isinscope(Date[Month Year])), [Meausre],[last MTD Sales])

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

Anonymous
Not applicable

I am using below

Profit = CALCULATE(SUM(Sales[Sales]),DATESMTD(Sales[Month]))
 
Which was driven from your above explanation and working so smooth.
 
Thanks bro.. Thanks ton 🙂
 
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors