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

Help with Formula DAX

Hello everyone,

I'm needing help from some mind higher than mine to do the following.

I have the following table of percentage inflation values month by month.

Nicopita77_0-1607220279263.png

I need to make a measure that allows me to calculate the cumulative inflation of 12 months but not those of the last month but of two previous years:

I have resolved the cumulative inflation of 12 months back from the selected date of the slicer on the left but I want that of the previous 12 months.

With the following measure create the cumulative inflation of the last 12 months of the selected date in the slicer.

Acum inflation. 12 months - CALCULATE(PRODUCTX('Inflation','Inflation'[Inflation]),DATESINPERIOD(Calendar[Date],LASTDATE(Calendar[Date]), -12,MONTH))-1
The other measure that I can't generate well is the one that gives 124.04% that brings me the accumulator of the 24 months but I want you to bring the first 12 months and be mobile from the date you select in the slicer. This measure I have to correct.
Acum inflation. 24 Months Ant. ? CALCULATE(PRODUCTX('Inflation','Inflation'[Inflation]),DATESINPERIOD(Calendar[Date],LASTDATE(Calendar[Date]), -24,MONTH))-1

Nicopita77_2-1607220583000.png

Thanks for the help!!!

3 ACCEPTED SOLUTIONS

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

You are welcome. You can download my PBI file from here.

I hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

13 REPLIES 13
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your MS Excel file with your formulas so that your calculation logic can be understood.  Also, on another tab in the workbook, please show the expected result in a simple table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks Ashish !!! You are the best my friend.

Here attached the link to download with the . PBIX file and inside it the created measures and the source I'm working.

https://drive.google.com/file/d/15IGuOfcaRCL6bvdU2mv_N4WGMhZVuj9n/view?usp=sharing


@Ashish_Mathur wrote:

Hello

Share the link from where I can download your MS Excel file with your formulas so you can understand your calculation logic. Also, on another tab of the workbook, display the expected result in a simple table format.



@Ashish_Mathur wrote:

Hello

Share the link from where I can download your MS Excel file with your formulas so you can understand your calculation logic. Also, on another tab of the workbook, display the expected result in a simple table format.


Hi,

That is not what i asked you for in my previous post.  Please read my previous post carefully.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Sorry....

Sorry, you're right... Below the link with the Excel with the calculation formulas and all the information.

https://drive.google.com/file/d/1pIDW00J5LqlMsPuXoqAL8T8zG7iOCIGV/view?usp=sharing

Thanks

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks !!! You are the best.

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Sorry Ashish,

If I need to recalculate this measure in function of the date selected in the slicer? For example 2020-Jan.

Thanks.

Hi,

I do not understand your requirement.  Clearly show the selection you would be making and show the percentage you are expecting as a result of that selection.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks again Ashish...

I really appreciate and value your help.

I put another version of the excel with the requirement. The Value need to change in function of the value selected in the slicer. More details in the excel (with examples)

https://drive.google.com/file/d/1FELxg8x1mulFMHkJy8I83hhADl3ETKog/view?usp=sharing

Thanks.

You are welcome. You can download my PBI file from here.

I hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Eternal gratitude!

Seriously you are the best my friend!!! Thanks....

You are welcome.  Thank you for your kind words.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.