Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
we are calculating a ytd based on fiscal year and period , if there is no data for selected period it should fall back to recent available period ! Amount is sliced in a matrix visual by Area ( A and B) . if Dept A doesnot have data for A for a selected period (3) it should fallback to recent available period (2) . But B does have vaule on period 3 !.
Solved! Go to Solution.
Create a Measure for YTD with Fallback:
YTD with Fallback =
VAR SelectedPeriod = MAX('Date'[Period])
VAR SelectedYear = MAX('Date'[Fiscal Year])
VAR LatestAvailablePeriod =
CALCULATE(
MAX('Date'[Period]),
FILTER(
ALL('Date'),
'Date'[Fiscal Year] = SelectedYear &&
'Date'[Period] <= SelectedPeriod &&
NOT ISBLANK([Amount])
)
)
VAR FallbackPeriod = IF(ISBLANK([Amount]), LatestAvailablePeriod, SelectedPeriod)
RETURN
CALCULATE(
SUM('Sales'[Amount]),
FILTER(
ALL('Date'),
'Date'[Fiscal Year] = SelectedYear &&
'Date'[Period] <= FallbackPeriod
)
)
In the matrix visual, this measure will slice the data by Area. For Dept A, it will automatically use the most recent available period if no data exists for the selected period. For Dept B, it will use the selected period if data is available.
It worked , thanks!
Create a Measure for YTD with Fallback:
YTD with Fallback =
VAR SelectedPeriod = MAX('Date'[Period])
VAR SelectedYear = MAX('Date'[Fiscal Year])
VAR LatestAvailablePeriod =
CALCULATE(
MAX('Date'[Period]),
FILTER(
ALL('Date'),
'Date'[Fiscal Year] = SelectedYear &&
'Date'[Period] <= SelectedPeriod &&
NOT ISBLANK([Amount])
)
)
VAR FallbackPeriod = IF(ISBLANK([Amount]), LatestAvailablePeriod, SelectedPeriod)
RETURN
CALCULATE(
SUM('Sales'[Amount]),
FILTER(
ALL('Date'),
'Date'[Fiscal Year] = SelectedYear &&
'Date'[Period] <= FallbackPeriod
)
)
In the matrix visual, this measure will slice the data by Area. For Dept A, it will automatically use the most recent available period if no data exists for the selected period. For Dept B, it will use the selected period if data is available.
would you know how to color the A and B (different colors) also the blank and fall back values . if you use a conditional formatting on Area it leaves out the blank and fallback values .
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |