Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

How can I have a Column Data Formulated in Power Bi and I need to display a column by replacing "1" with Text value 

Formula:

Age (18-27) = IF(AND([Age]>17, [Age]<28),"1",BLANK())
Age (28-35) = IF(AND([Age]>27, [Age]<36),"1",BLANK())
Age (36-43) = IF(AND([Age]>35, [Age]<44),"1",BLANK())
Age (44-50) = IF(AND([Age]>43, [Age]<51),"1",BLANK())
Age (50+) = IF([Age]>50,"1 ", BLANK())

Output:

Age (18-27) = IF(AND([Age]>17, [Age]<28),"Age (18-27)",BLANK())
Age (28-35) = IF(AND([Age]>27, [Age]<36),"Age (28-35)",BLANK())
Age (36-43) = IF(AND([Age]>35, [Age]<44),"Age (36-43)",BLANK())
Age (44-50) = IF(AND([Age]>43, [Age]<51),"Age (44-50)",BLANK()) Age (50+) = IF([Age]>50,"Age (50+) ", BLANK()) 

1 Answer

0 votes
by (22.5k points)

Use the following measure:

Age Group = IF(AND([Age]>17, [Age]<28),"18-27",
 IF(AND([Age]>27, [Age]<36),"28-35",
  IF(AND([Age]>35, [Age]<44),"36-43",
   IF(AND([Age]>43, [Age]<51),"44-50",
    IF([Age]>50,"50+", BLANK())
))))

If u wish to learn about this BI tool, then you can sign up Power BI Certification   

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 21, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
asked Dec 31, 2020 in BI by Chris (11.1k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...