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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Mike_Mace
Resolver I
Resolver I

Filtering curves to not show straight horizontal sections

I have a graph with 3 running measures as per snip. I use a calendar based Dax code.

 

I want to use a filter to stop curves as a curve-visual and do not show the horizontal sections which do not bring any value to the visual. Ideas?

I'd prefer to not use the time filter because each curve will span on different timelines.

Thanks

 

curvescurves

1 ACCEPTED SOLUTION

Hi , @Mike_Mace 

Please refer to this demo.

Take the measure "Actual Running" as an example.You only need to add an if condition to the measure.

Actual Running2 = 
var _date = SELECTEDVALUE('Date Calendar'[Date Calendar])
var _maxdate = 
CALCULATE(
    MAX(Actuals[Actual Date]),
    ALLSELECTED(Actuals)
)
return
IF(
   _date<=_maxdate,
    CALCULATE(
        SUM('Actuals'[Actual]),
        FILTER(
            ALLSELECTED('Date Calendar'[Date Calendar]),
            'Date Calendar'[Date Calendar] <= MAX('Date Calendar'[Date Calendar])
        )
    )
)

The result is show as below:

 

20.png

Best Regards,
Community Support Team _ Eason
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

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi , @Mike_Mace 

If there is a horizontal section in the middle of the curve-visual, does it also not display or  show as 0?

It will be helpful ,if you can  provide some sample data and the formula of measure.

Here is a sampe.(please see report page1)

 

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

Hi @v-easonf-msft  ,

 

The visual on your page one is the neat graph I need to reach.

 

The calendar is daily, and the deliverables are on random dates, so Yes there are horizontal sections in the middle of the graphs.  Yes I need to be careful to not corrupt the data on those sections. Data on link.

 

I am conscious what amount of horizontal sections would be acceptable as the same due to pandemic effects on deliverables. Maybe experiment with 100/150days is an idea.

Hi @v-easonf-msft  again,

 

Tried your DAX, replaced with my measures but it doesn't seem to be working. 

I get an error on te use of measures. "Column Recovery Running in Table Recovery cannot be found or may not be used in this expression."

 

Could it becuase of the forumla that I use for calculating Running amount?

Recovery Running =
CALCULATE(
    (SUM('Recovery'[Recovery]) + SUM('Actuals'[Actual])),
    FILTER(
        ALLSELECTED('Date Calendar'[Date Calendar]),
        'Date Calendar'[Date Calendar] <= MAX('Date Calendar'[Date Calendar])
    )
)
 
 

Hi , @Mike_Mace 

Please refer to this demo.

Take the measure "Actual Running" as an example.You only need to add an if condition to the measure.

Actual Running2 = 
var _date = SELECTEDVALUE('Date Calendar'[Date Calendar])
var _maxdate = 
CALCULATE(
    MAX(Actuals[Actual Date]),
    ALLSELECTED(Actuals)
)
return
IF(
   _date<=_maxdate,
    CALCULATE(
        SUM('Actuals'[Actual]),
        FILTER(
            ALLSELECTED('Date Calendar'[Date Calendar]),
            'Date Calendar'[Date Calendar] <= MAX('Date Calendar'[Date Calendar])
        )
    )
)

The result is show as below:

 

20.png

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

 

 

 

Greg_Deckler
Super User
Super User

This is going to depend on your data and whether you can compare the current value with the previous value and how many previous values need to be the same before you "quit".

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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