Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I've been trying to wrap my head around how to go about building a measure based on selectedvalue to calculate year over year growth. I have a chicklet slicer with selections for fiscal years 20, 21, & 22. I want to calculate revenue growth ($) on a Card that will change based on the chicklet selections, which is a multi-select.
If FY20 and FY22 are selected, the card will show (FY22 - FY20) revenue.
If FY20, FY21, AND FY22 are selected, the card will show (FY22-20) revenue.
If no options are selected, the card should show (FY22-20) revenue.
If FY21 is selected, card will show FY21 revenue.
etc...
Appreciate any help!
G23
Solved! Go to Solution.
I think you can cover all the scenarios by just looking at the max and min FY selected.
RevGrowth =
VAR MinFY = MIN ( Dim_Date[FiscalYear] )
VAR MaxFY = MAX ( Dim_Date[FiscalYear] )
VAR RevMinFY = CALCULATE ( [Revenue], TREATAS ( { MinFY }, Dim_Date[FiscalYear] ) )
VAR RevMaxFY = CALCULATE ( [Revenue], TREATAS ( { MaxFY }, Dim_Date[FiscalYear] ) )
RETURN
IF ( MinFY = MaxFY, RevMaxFY, RevMaxFY - RevMinFY )
I think you can cover all the scenarios by just looking at the max and min FY selected.
RevGrowth =
VAR MinFY = MIN ( Dim_Date[FiscalYear] )
VAR MaxFY = MAX ( Dim_Date[FiscalYear] )
VAR RevMinFY = CALCULATE ( [Revenue], TREATAS ( { MinFY }, Dim_Date[FiscalYear] ) )
VAR RevMaxFY = CALCULATE ( [Revenue], TREATAS ( { MaxFY }, Dim_Date[FiscalYear] ) )
RETURN
IF ( MinFY = MaxFY, RevMaxFY, RevMaxFY - RevMinFY )
you could probably use concatenex combining your fiscal year values
doing somethink like this
create measure
Proud to be a Super User!
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
99 | |
92 | |
50 | |
49 | |
46 |