The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
How can i calculate in PBI if my date is between 10/1/2021 and 9/30/2022 that it multiplies by 'x rate'. If the date is between 10/1/2022 and 9/30/2023 that it multiples by 'y date'.
Basically my rate changes every year and want to be able to see the old rate during the correct time period and the new year during the new time period.
Solved! Go to Solution.
Hi @Bryanna
I would use switch function. Below how the sample measure will look like
switch =
SWITCH(TRUE(),
min('Table'[Date])<=date(2022,09,30), "x multiples measure",
Min('Table'[Date])<=date(2023,09,30), "y multiples measure"
)
you can either create measure to multiple by x or y OR directly use the formula inside switch.
Hope this helps!
Thanks,
AnthonyJospeh
Does my date column need to be in a certain format? Its not recognizing the date and is categorizing everything as the same.
Hi @Bryanna , I think your column is in "Date/time" datatype format. Please can you change to "Date" datatype and try the measure.
Thanks,
AnthonyJoseph
Hi @Bryanna
I would use switch function. Below how the sample measure will look like
switch =
SWITCH(TRUE(),
min('Table'[Date])<=date(2022,09,30), "x multiples measure",
Min('Table'[Date])<=date(2023,09,30), "y multiples measure"
)
you can either create measure to multiple by x or y OR directly use the formula inside switch.
Hope this helps!
Thanks,
AnthonyJospeh
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |