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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
WaelTalaat79
Helper I
Helper I

Measure improvement "Speed up calculation process"

HI, @SpartaBI 
Related to below Ticket
https://community.powerbi.com/t5/Desktop/Measurement-Time-out/m-p/2557968#U2557968

 

i need to facilitate the below mesure to Speed up calculation process

i need to get the monthly impacy by sbtruct the current month value - previous month
but when i do it the calcoulation consider the previous month od Jan is DEC. with value but dec. should be zero

PR for PreivMonth =
(CALCULATE([YTD PR Calculate],PREVIOUSMONTH('Date'[Date].[Date])))
1.JPG
1 ACCEPTED SOLUTION

@WaelTalaat79 here you go:

PR for PreivMonth 2 =

if([YTD PR Calculate]=0,0, CALCULATE([YTD PR Calculate],DATEADD('Date'[Date].[Date],-1,MONTH)))



View solution in original post

4 REPLIES 4
WaelTalaat79
Helper I
Helper I

@SpartaBI 
can you help here

@WaelTalaat79 will pm you

@WaelTalaat79 here you go:

PR for PreivMonth 2 =

if([YTD PR Calculate]=0,0, CALCULATE([YTD PR Calculate],DATEADD('Date'[Date].[Date],-1,MONTH)))



amitchandak
Super User
Super User

@WaelTalaat79 , Based on what I got. With help from the date table, Try YTD, YTD till last most

 

YTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1*MONTH(_max))+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

 

YTD till Last month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),-1)
var _min = eomonth(_max,-1*MONTH(_max))+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors