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
THENNA_41
Post Partisan
Post Partisan

Please any one correct my measure

   i want  get current month and previous divide percentage value same like  previous year and  current year .  i have attached my sample pbix file . i  have created measure but not working . 

 

sample File : Sample PBIX File  

 

Thanks in advance .

 

Regards,

Thennarasu 

5 REPLIES 5
THENNA_41
Post Partisan
Post Partisan

@Greg_Deckler  i have tired but values are matching .

@THENNA_41 The question is, what are you trying to achieve? Let's say you have 1000 for current and 800 for previous, what do you want the result to be? 1000/800 = 1.25, 800/1000 = .8, (1000-800)/1000 = .2, (1000-800)/800 = .25 or something completely different?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
THENNA_41
Post Partisan
Post Partisan

@Greg_Deckler  how to convert this value to percentage .  i got  measure value 1.96  . i am try to convert this value ti percentage . its goes 196 %  .  

@THENNA_41 Maybe:

Measure =
  VAR __CurrentDate = MAX('Calendar'[Date])
  VAR __EOCurrentMonth = EOMONTH(__CurrentDate,0)
  VAR __BeginCurrentMonth = DATE(YEAR(__EOCurrentMonth),MONTH(__EOCurrentMonth),1)
  VAR __EOPrevMonth = EOMONTH(__CurrentDate,-1)
  VAR __BeginPrevMonth = DATE(YEAR(__EOPrevMonth),MONTH(__EOPrevMonth),1)
  VAR __Current = CALCULATE(<something>,'Calendar'[Date]>=__BeginCurrentMonth,'Calendar'[Date]<=__EOCurrentMonth)
  VAR __Previous = CALCULATE(<something>,'Calendar'[Date]>=__BeginPrevMonth,'Calendar'[Date]<=__EOPrevMonth)
RETURN
  DIVIDE(__Current - __Previous,__Previous,0)

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@THENNA_41 Here is one method:

Measure =
  VAR __CurrentDate = MAX('Calendar'[Date])
  VAR __EOCurrentMonth = EOMONTH(__CurrentDate,0)
  VAR __BeginCurrentMonth = DATE(YEAR(__EOCurrentMonth),MONTH(__EOCurrentMonth),1)
  VAR __EOPrevMonth = EOMONTH(__CurrentDate,-1)
  VAR __BeginPrevMonth = DATE(YEAR(__EOPrevMonth),MONTH(__EOPrevMonth),1)
  VAR __Current = CALCULATE(<something>,'Calendar'[Date]>=__BeginCurrentMonth,'Calendar'[Date]<=__EOCurrentMonth)
  VAR __Previous = CALCULATE(<something>,'Calendar'[Date]>=__BeginPrevMonth,'Calendar'[Date]<=__EOPrevMonth)
RETURN
  DIVIDE(__Current,__Previous,0)

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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