Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
This measure calculates the actual fiscal year sales up to the current month.
As you can see 'CALENDAR'[FiscalYearOrder] is the field that contains the fiscal year, so I make sure that it is equal to the MAX fiscal year, wich will be the current year.
Then I make sure that 'CALENDAR'[FiscalMonthOrder] wich is the fiscal month in order from 1 to 12, is less or equal to the actual month's fiscal month order.
CALCULATE(
SUM('FORECASTxSALES'[SALES]),
FILTER(
ALL('CALENDAR'),
(
('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &&
( VALUE('CALENDAR'[FiscalMonthOrder]) <= (IF(VALUE(MONTH(TODAY()))>=9,VALUE(MONTH(TODAY()))-8,VALUE(MONTH(TODAY()))+4)))
)
)
)
I want to modify this measure so that it takes the maximun FiscalMonthOrder of the filtered CALENDAR table instead the actual month's fiscal month order. The problem is that in this measure I have already used ALL() to remove the filters of the CALENDAR table.
CALCULATE(
SUM('FORECASTxSALES'[SALES]),
FILTER(
ALL('CALENDAR'),
(
('CALENDAR'[FiscalYearOrder] = MAX('CALENDAR'[FiscalYearOrder])) &&
( VALUE('CALENDAR'[FiscalMonthOrder]) <= MAX('CALENDAR'[FiscalMonthOrder]))
)
)
)
The previous example would return the maximun FiscalMonthOrder of the calendar table, but if the user has filtered the FiscalMonthOrder it wouldn't impact the masure, and I want it to impact.
I want the measure to return the actual fiscal year sales up to the maximun month selected by the user.
Hello!
Assuming FiscalMonthOrder is the field the user is selecting in a slicer, I've modified your measure to the below. I created a variable to hold the selected month if the report viewer has picked one and the maximum FiscalMonthOrder (like you originally had) if the report viewer has not.
Please let me know if this works for you or if you were looking for something different. 😄
VAR SelectedMonth =
IF (
HASONEVALUE ( 'CALENDAR'[FiscalMonthOrder] ),
SELECTEDVALUE ( 'CALENDAR'[FiscalMonthOrder] ),
MAX ( 'CALENDAR'[FiscalMonthOrder] )
)
RETURN
CALCULATE (
SUM ( 'FORECASTxSALES'[SALES] ),
FILTER (
ALL ( 'CALENDAR' ),
(
( 'CALENDAR'[FiscalYearOrder] = MAX ( 'CALENDAR'[FiscalYearOrder] ) ) &&
( VALUE ( 'CALENDAR'[FiscalMonthOrder] ) <= SelectedMonth )
)
)
)
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |