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,
Hoping for assistance with a query;
I need a % change/delta between the most recent month and the month at the start of the year, where the start of the year begins in September.
The data has different org's that the delta's need to split.
Below is the example data and result I'm trying to create:
| Org | Period | Total |
| 100 | Aug-23 | 200 |
| 100 | Sep-23 | 210 |
| 100 | Oct-23 | 230 |
| 100 | Nov-23 | 200 |
| 100 | Dec-23 | 250 |
| 100 | Jan-24 | 220 |
| 200 | Aug-23 | 500 |
| 200 | Sep-23 | 510 |
| 200 | Oct-23 | 490 |
| 200 | Nov-23 | 480 |
| 200 | Dec-23 | 470 |
| 200 | Jan-24 | 430 |
When reporting for Jan-24, the results should look like:
| Org | YTD Total Change |
| 100 | 4.8% |
| 200 | -14.0% |
Thanks in advance!
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
One of ways to create solution is to have fiscal month number and fiscal year columns in the calendar table (or period table).
Please check the below picture and the attached pbix file.
expected result measure: =
VAR _latestmonth =
MAXX ( SUMMARIZE ( Data, Period[Period] ), Period[Period] )
VAR _latestfiscalmonth =
MAXX (
FILTER ( Period, Period[Period] = _latestmonth ),
Period[Fiscal Month Number]
)
VAR _fiscalyear =
MAXX ( SUMMARIZE ( Data, Period[Fiscal Year] ), Period[Fiscal Year] )
VAR _latestvalue =
CALCULATE (
SUM ( Data[Total] ),
Period[Fiscal Month Number] = _latestfiscalmonth,
Period[Fiscal Year] = _fiscalyear
)
VAR _firstvalue =
CALCULATE (
SUM ( Data[Total] ),
Period[Fiscal Month Number] = 1,
Period[Fiscal Year] = _fiscalyear
)
RETURN
DIVIDE ( _latestvalue - _firstvalue, _firstvalue )
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
One of ways to create solution is to have fiscal month number and fiscal year columns in the calendar table (or period table).
Please check the below picture and the attached pbix file.
expected result measure: =
VAR _latestmonth =
MAXX ( SUMMARIZE ( Data, Period[Period] ), Period[Period] )
VAR _latestfiscalmonth =
MAXX (
FILTER ( Period, Period[Period] = _latestmonth ),
Period[Fiscal Month Number]
)
VAR _fiscalyear =
MAXX ( SUMMARIZE ( Data, Period[Fiscal Year] ), Period[Fiscal Year] )
VAR _latestvalue =
CALCULATE (
SUM ( Data[Total] ),
Period[Fiscal Month Number] = _latestfiscalmonth,
Period[Fiscal Year] = _fiscalyear
)
VAR _firstvalue =
CALCULATE (
SUM ( Data[Total] ),
Period[Fiscal Month Number] = 1,
Period[Fiscal Year] = _fiscalyear
)
RETURN
DIVIDE ( _latestvalue - _firstvalue, _firstvalue )
I'd recommend making sure your model has a calendar table and inside that calendar table you have a "Fiscal Month" column which numerically holds the numbers 1 to 12 and a "Fiscal Year" column. 1 in your case would be September. From here you could have a measure like the below. Place this measure within your usual Org context with your monthly periods.
YTD Total Change = var currentFiscalYear = SELECTEDVALUE('Calendar'[Fiscal Year])
var currentResult = SUM('Data'[Total])
var firstResult = CALCULATE(
SUM('Data'[Total]),
ALL('Calendar'),
FILTER(
'Calendar'
'Calendar'[Fiscal Year] = currentFiscalYear &&
'Calendar'[Fiscal Month] = 1
)
)
RETURN
DIVIDE(currentResult, firstResult)
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 |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |