Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi can someone help me to cretae a multiple if statement column calculation in Dax?
= IF('Start Date'[Length of Tenure Absolute]<13,12,0), IF(AND('Start Date'[Length of Tenure Absolute]<25, 'Start Date'[Length of Tenure Absolute]>12),24,0),
IF and so on until 60 months
thanks!
Hi @ballist1x,
I have make a demo which you could have a try.
column = IF ( 'Start Date'[Length of Tenure Absolute] < 13, 12, IF ( 'Start Date'[Length of Tenure Absolute] > 12 && 'Start Date'[Length of Tenure Absolute] < 25, 24, IF ( 'Start Date'[Length of Tenure Absolute] > 24 && 'Start Date'[Length of Tenure Absolute] < 49, 48, IF ( 'Start Date'[Length of Tenure Absolute] > 48 && 'Start Date'[Length of Tenure Absolute] < 61, 60, 0 ) ) ) )
You could change the data in the condition as yours in this format.
In addition, you could make a reference of this similar post.
If you need additional help please share some data sample. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)
Best Regards,
Cherry
Hi i went for this in the end:
Less than 12 months = IF('Start Date'[Length of Tenure Absolute]<13,1,0)
12 Month Margin = (calculate(SUM('H12015'[Margin (£)]), (FILTER(ALL('Start Date'),('Start Date'[Length of Tenure Absolute]>=1 && ('Start Date'[Length of Tenure Absolute]<=12))))))/Sum('Start Date'[Less than 12 months])
then
Less than 24 months = IF(AND('Start Date'[Length of Tenure Absolute]<25, 'Start Date'[Length of Tenure Absolute]>12),2,0)/2
24 Month Margin = (calculate(SUM('H12015'[Margin (£)]), (FILTER(ALL('Start Date'),('Start Date'[Length of Tenure Absolute]>=12 && ('Start Date'[Length of Tenure Absolute]<=24))))))/Sum('Start Date'[Less than 24 months])
and do on, is this correct?
Hey,
I assume you are looking for the DAX function SWITCH(...)
Here is a example how you can leverage SWITCH with the boolean expression TRUE
Read until you find the answers from @greggyb, for now the last post links to more articles advocating for SWITCH
Hope this is what you are looking for
Tom
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
165 | |
83 | |
68 | |
68 | |
59 |