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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

help for date segment filter

201909101512_00.jpg201909101513_00.jpg

HI im french and i try to do two visual like those photos for Suez france, and i start my mission so i need help, 

Thank you ,
Raphael

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You can just change the variable "s" in the second formula to the calculate the turnover sale range if the value in this row.

 

Sakrange =
VAR s = [cost] / [total]
RETURN
    IF (
        s > 1,
        ">1",
        IF (
            s > 0.5,
            "0.5 - 1",
            IF ( s > 0.25, "0.25 - 0.5", IF ( s > 0.1, "0.1 - 0.25", "<0.1" ) )
        )
    )

The Thought of this formula is just to calculate the value for each row and judge this value to create a new column by group.

 

Best regards,

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

Community Support Team _ Dong Li
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
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Before my answer, I want to remind you that this is a public community forum, you should not put your personal information in your post such as company information. You'd better edit this, just leave problem describtion and your requirement is enough.

 

For the first picture, you can create a calculate column in your data table like following

 

 

DateSegment =
IF (
    [End Date] - [Start Date] > 180,
    ">6 month",
    IF ( [End Date] - [Start Date] > 90, ">3 month <6 month", "<3 month" )
)

 

12.PNG

 

11.PNG

 

For the second picture, so I assume sake range is something like the date range.

 

 

Sakrange =
VAR s = [Sak End] - [Sak Start]
RETURN
    IF (
        s > 1,
        ">1",
        IF (
            s > 0.5,
            "0.5 - 1",
            IF ( s > 0.25, "0.25 - 0.5", IF ( s > 0.1, "0.1 - 0.25", "<0.1" ) )
        )
    )

 

 

13.PNG14.PNG

 

 


If it doesn't meet your requirement, kindly share your  excepted result to me based on my sample data.

 

BTW, pbix as attached.

 

Best regards,

 

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

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank for your time and your answer ! I do the first visual it work good, For the second it's not a date range but a turnover sale range sorry for my writing .

Hi @Anonymous ,

 

You can just change the variable "s" in the second formula to the calculate the turnover sale range if the value in this row.

 

Sakrange =
VAR s = [cost] / [total]
RETURN
    IF (
        s > 1,
        ">1",
        IF (
            s > 0.5,
            "0.5 - 1",
            IF ( s > 0.25, "0.25 - 0.5", IF ( s > 0.1, "0.1 - 0.25", "<0.1" ) )
        )
    )

The Thought of this formula is just to calculate the value for each row and judge this value to create a new column by group.

 

Best regards,

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

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.