Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Slicer Value with calculted column

Hello All,

We have Dataset like below

ID Name Age
--- ---- ----
10 AAA 40
20 BBB 34
30 CCC 68
40 DDD 58
50 EEE 79
60 FFF 39
70 GGG 28


I want to create slicer visaul with age column like below

Age_Calc
-----
10
20
30
40
50
60
70
80
90
100

 

I tried to create caluculted column : if(Table1(Age)>10,10,if(Table1(Age)>20,20,.....,If(Table1(Age)>100,100)))..But does not give correct result.

It reruns only
10,100 only instead of 10,20,30..100.

 

Thanks

Narasimha Reddy

 

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my test, you could refer to below formula:

Column =
IF (
    [Age] < 20,
    10,
    IF (
        'Table1'[Age] < 30,
        20,
        IF (
            [Age] < 40,
            30,
            IF (
                [Age] < 50,
                40,
                IF ( [Age] < 60, 50, IF ( [Age] < 70, 60, IF ( [Age] < 80, 70 ) ) )
            )
        )
    )
)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my test, you could refer to below formula:

Column =
IF (
    [Age] < 20,
    10,
    IF (
        'Table1'[Age] < 30,
        20,
        IF (
            [Age] < 40,
            30,
            IF (
                [Age] < 50,
                40,
                IF ( [Age] < 60, 50, IF ( [Age] < 70, 60, IF ( [Age] < 80, 70 ) ) )
            )
        )
    )
)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
themistoklis
Community Champion
Community Champion

Can you try changing the formula and add the AND statement to specify the ranges?

E.g.

 

IF( AND(Table1(Age)>=0, Table1(Age)<=10) , 10 ,
IF( AND(Table1(Age)>10, Table1(Age)<=20) , 20 ,
IF( AND(Table1(Age)>20, Table1(Age)<=30) , 30 ,
etc

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.