Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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:
| FirstDayOfMonth | CustomerId | Price | Date |
| 2018-02-01 00:00:00.000 | 11478 | 80 | 2018-02-01 00:00:00.000 |
| 2018-02-01 00:00:00.000 | 11478 | 129 | 2018-02-01 00:00:00.000 |
| 2018-02-01 00:00:00.000 | 11478 | 128 | 2018-02-01 00:00:00.000 |
| 2018-02-01 00:00:00.000 | 11478 | 249 | 2018-02-01 00:00:00.000 |
| 2018-03-01 00:00:00.000 | 11478 | 249 | 2018-03-01 00:00:00.000 |
| 2018-03-01 00:00:00.000 | 11478 | 128 | 2018-03-01 00:00:00.000 |
Anyone an idea of what i'm doing wrong?
Solved! Go to Solution.
If you remove the non-related "Date" field from the table, does it show up?
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?
Thanks David! The date field in the grid was the issue.
It works now.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |