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

Nested Measure

I'm trying to simplify my formulas by relying on another defined measure, but can't seem to get it working.

In this example, the dates need to be shifted back a month but otherwise use the same function for the current month.

The measure in reference uses Dates[Date] as the driver and works fine.

Any thoughts on how to get this "nested" measure working?

 

VAR Date2 = PREVIOUSMONTH(Dates[Date]) RETURN
sumx(filter(Dates,Dates[Date]=Date2),[Revenue])

1 ACCEPTED SOLUTION

There are a dozen tables with dates and relationships within - so that's not really an option. All measures are written as some form of sumx(values(dates) or using max(dates) as a workaround.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE([Revenue],PREVIOUSMONTH(Dates[Date]))

 

There should be a relationship from the Date column of your base data table to the Date column of your Dates table.  In the Dates table, extract the month in another column by using the =FORMAT(Dates[Date],"mmmm") formula.  In your visual, drag the Month column from your Calendar table.


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

There are a dozen tables with dates and relationships within - so that's not really an option. All measures are written as some form of sumx(values(dates) or using max(dates) as a workaround.

Hi @avalerion

The formula @Ashish_Mathur posted is right. What's meaning of "so that's not really an option"? Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Thanks,
Angelia

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.