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.
Helo Guys,
I work with insurance and some policies has different terms than a year (for example more similar to fiscal years: from April to April).
I'm struggling to develop this dax:
Term = if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2015),"2015-2016",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2016),"2016-2017",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2017),"2017-2018",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2018),"2018-2019",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2019),"2019-2020",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2020),"2020-2021",
if('Property - Historycal Claims (2015 - 2021)'[Claim Date]>=DATE(30/3/2021),"2021-2022","2022-2023")
The result of the entire column is only the first value: "2015-2016", but I have data until 2020.
The Claim Date column is settled as "date".
Solved! Go to Solution.
You could rewrite this simpler with SWITCH(TRUE(), ... but the issue is that all your date are >= 3/30/2015 so all meet the condition and get "2015-2016". Reverse all your IF statements (>=3/31/2021 first) to get your desired result.
DAX - The Diabolical Genius of “SWITCH TRUE” - P3 (powerpivotpro.com)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You could rewrite this simpler with SWITCH(TRUE(), ... but the issue is that all your date are >= 3/30/2015 so all meet the condition and get "2015-2016". Reverse all your IF statements (>=3/31/2021 first) to get your desired result.
DAX - The Diabolical Genius of “SWITCH TRUE” - P3 (powerpivotpro.com)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thank you Sir,
This is the formula that works:
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
10 | |
8 |