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
KLRK
Frequent Visitor

Using different time intellingence functions for nested measures

Hi everyone,

I have a problem with conflicting time intelligence functions.

 

In my report I'd like to show the revenue of the last X months + their respective previous month revenue from one filtered date.

 

EXAMPLE for last 12 months

 

 

 

Measure1 = SUM('Orders'[Revenue]) 
Measure2 = 
    CALCULATE (
        [Measure1],
        DATESINPERIOD ('Calendar'[Date], MAX('Calendar'[Date]), -12, MONTH)
    )
CalculatedColumn = RELATED('Calendar'[Month]) & " " & RELATED('Calendar'[Year])

 

 

 

Dragging Measure2 as Values and CalculatedColumn as Axis on a barchart makes a nice graph showing the revenue for each of the last 12 month.

 

RevLast12month.PNG

 

 

I now want to have a side to side comparison with the revenue from the respective previous month.

 

 

//add Measure for sum of previous month

Measure3 = CALCULATE(Measure1, PARALLELPERIOD('Calendar'[Date], -1 , MONTH))
Measure4 =
CALCULATE (
[Measure2],
DATESINPERIOD ('Calendar'[Date], MAX('Calendar'[Date]), -12, MONTH)
)

 

 

 

Dragging this measure as additional Values on the same chart is showing the sum of revenue in the actual month though and not as previous month value for a corresponding month.

 

RevLast12monthAndPrvMonth.PNG


Meaning that now there are Values for 13 month on my chart. With 2 times the same values for the inner month of the 13 and 1 bar for each of the first ans last month, coming from the two different measures.

 

In the end I also want to calculate and visualize the delta (eg. Revenue Month n - Revenue month n-1). Right now this would end up  with a funny graph where all the inner month equal out to 0 and first and last month the delta to 0.

 

RevLast12monthDelta.PNG

 

 

How can I solve this issue w/o going back to check the last 12 month one by one in my filters.

 

I appreciate any kind of help.

Thanks!!

 

PS: I can provide a .pbix with the demo data if needed!

4 REPLIES 4
parry2k
Super User
Super User

@KLRK you have to wrap DATEINPERIOD in KEEPFILTERS

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

KLRK
Frequent Visitor

@parry2kcould you elaborate at which point?

 

A function like the one below won't do the job but rather do the opposite:

 

Measure4_SumOfRevenuePrevMonthLast12Month = 
    CALCULATE (
        [Measure3_SumOfRevenuePrevMonth],
        KEEPFILTERS(DATESINPERIOD ('Calendar'[Date], MAX('Calendar'[Date]), -12, MONTH))
    )

 

parry2k
Super User
Super User

@KLRK why you are using the calculated column on the x-axis, you should be using it from the calendar table?

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

KLRK
Frequent Visitor

Hi!

 

If I use it from the calendar table it will show one bar for October with the aggregated data of the last 12 month.

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.