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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
WilfredK
Frequent Visitor

Empty result previousmonth

Hi all,

 

I'm using the following measure in my report.

I want to summarize the price of the previous month. The result stays empty.  

 

PriceLastMonth = CALCULATE (
sum('StoredProcedure'[Price]);
FILTER (
ALL ('StoredProcedure');'StoredProcedure'[FirstDayOfMonth] = PREVIOUSMONTH('Date'[Date])
)
)

 

Notes:

'Date'[Date] is a single value from a created timetable. 

 

part of the datamodel looks like this:

 

FirstDayOfMonthCustomerIdPriceDate
2018-02-01 00:00:00.00011478802018-02-01 00:00:00.000
2018-02-01 00:00:00.000114781292018-02-01 00:00:00.000
2018-02-01 00:00:00.000114781282018-02-01 00:00:00.000
2018-02-01 00:00:00.000114782492018-02-01 00:00:00.000
2018-03-01 00:00:00.000114782492018-03-01 00:00:00.000
2018-03-01 00:00:00.000114781282018-03-01 00:00:00.000

 

Anyone an idea of what i'm doing wrong?

1 ACCEPTED SOLUTION

If you remove the non-related "Date" field from the table, does it show up?

 

Capture.PNG

View solution in original post

4 REPLIES 4
dedelman_clng
Community Champion
Community Champion

Please try this

 

PriceLastMonth = CALCULATE (
     sum('StoredProcedure'[Price]);
     PREVIOUSMONTH('StoredProcedure'[Date])  //<-- This should be the date column that has a relationship to the Date table
)

Hope that helps,

David

Hi David, thnx for your reply. It didn't work. 

Result is the same, previous month stays empty. 

If you remove the non-related "Date" field from the table, does it show up?

 

Capture.PNG

Thanks David! The date field in the grid was the issue.

It works now. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors