Forum Discussion
Anonymous
3 years agoNot applicable
Creating one Dax formula for multiple IF statements
@ links to members, content Hello I need assistance in getting this IF statement to work in Dax formula. I am trying to group my data based on gift amounts. I have tried the grouping functio...
Waqas_BIspecs
3 years agoFrequent Visitor
OK before i post the example, the potential problem i see here that bin values are overlapping which is making it difficult for you to handle.
for reccuring 1st bin is between 10 - 49.99 while for single the bin is 10 - 499.99. We can not handle this the way you are trying to handle in one statement. if you can somehow manage a unique bin size then below will definitely help.
Step1: Create a conditional columns to define the bins
Step2: You can create a conditional column to compare these with Reccuring / Single
Step2:
Create a Conditional Column for comparison
Comparison = if(Sheet1[Brackets] = "A" && 'Sheet1'[hmg_gift_cycle] = "Recurring", "Recurring 10 - 99.99" ,
if(Sheet1[Brackets] = "B" && 'Sheet1'[hmg_gift_cycle] = "Recurring", "Recurring 100 - 249.99",
if(Sheet1[Brackets] = "C" && 'Sheet1'[hmg_gift_cycle] = "Recurring", "Recurring 500 - 999.99",
if(Sheet1[Brackets] = "D" && 'Sheet1'[hmg_gift_cycle] = "Recurring", "Recurring 1000 +",
if(Sheet1[Brackets] = "A" && 'Sheet1'[hmg_gift_cycle] = "Single", "Single 10 - 99.99" ,
if(Sheet1[Brackets] = "B" && 'Sheet1'[hmg_gift_cycle] = "Single", "Single 100 - 249.99",
if(Sheet1[Brackets] = "C" && 'Sheet1'[hmg_gift_cycle] = "Single", "Single 500 - 999.99",
if(Sheet1[Brackets] = "D" && 'Sheet1'[hmg_gift_cycle] = "Single", "Single 1000 +"))))))))