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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Tini-Bee
Frequent Visitor

Alter DAX measure to display highest value in a line chart

I want to return the highest Sum Range Space ( ie check and store the highest value 6408) in the Line chart below. I want the line chart to be straight and not 'dip' to 300 on dates when Sum Range Space is below 6408

TiniBee_0-1739091940035.png


I've selected two Houses; 
1)  House 1 with Sum Range Space = 6108
2) House 2 with Sum Range Space = 300

When both are selected they should return Sum Range Space = 6408 and not 300 as in the screenshot above

Measure I want to alter:

Sum Range Space =
VAR RangeSpaceCount = CALCULATE(COUNT(' Build_Capacity'[RangeSpace]

VAR TotalCount =  CALCULATE(DISTINCTCOUNT('Build_Usage'[ID]), ALL('Date'))

VAR BLANKK = BLANK()

RETURN

    IF (

        (

            ISFILTERED ( 'Hs'[House Name] )

                && RangeSpaceCount = TotalCount

        ),

        [SumRangeSpace1],

        BLANK()

    )


The underlying measure [SumRangeSpace1] is

SumRangeSpace1 = CALCULATE (

    SUM( 'Build_Capacity'[RangeSpace] ),

    TREATAS (

        VALUES ( 'Build_Usage'[ID] ),

        'Build_Capacity'[ID]

    )

)


Build_Capacity

TiniBee_1-1739092318313.png

Build_Usage

TiniBee_2-1739092366049.png

 


Relationship

TiniBee_3-1739092397342.png

 



2 ACCEPTED SOLUTIONS
speedramps
Community Champion
Community Champion

We want to help you but your description is too vague. Please write it again clearly.

Please DON'T copy & paste your DAX that does not work and expect us to fathom what you want to do. That is a bit crazy. 😀

Please just give a simple non technical functional description of what you want, then let us suggest the solution. Thank you.

Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.

Remove any unneeded columns which may cause confusion.

Rename columns to user friendly names. Avoid jargon like Build_Capacity'[RangeSpace].
Also provide the example desired output, with a clear step-by-step description of calculations the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Remember you are gertting free expert help, so please put lots of proper effort to asking questions and providing examples.

Vaugue descriptions can waste your time and our time.

Look forward to helping you when the above information is forthcoming

 

Perhaps you can learn DAX and adapt the logic from this example, which prevents the line dropping below 20% of the max. 

Note how the CALCUALATE use ALL to get the max value.

 

Then the IF returns the actual or base value 

 

Please click thumps up for the helpful suggestions and then [accept solution] if it works.  Thanks

 

 

Answer = 
// Get your actual value
var actualvalue = SUM(yourdata[Amount])

// Get 20% of max value
var base =
CALCULATE( 
    MAX(yourdata[Amount]),  
    ALL(yourdata[Dates])
    ) 
    * 0.20

RETURN
// dont go below the base value
IF(actualvalue < base, base, actualvalue)

 

 

 

speedramps_1-1739109457649.png

 

 

 

 

View solution in original post

rectified this issue using 
CALCULATE([SumRangeSpace1], ALL('Date'))

View solution in original post

3 REPLIES 3
speedramps
Community Champion
Community Champion

We want to help you but your description is too vague. Please write it again clearly.

Please DON'T copy & paste your DAX that does not work and expect us to fathom what you want to do. That is a bit crazy. 😀

Please just give a simple non technical functional description of what you want, then let us suggest the solution. Thank you.

Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.

Remove any unneeded columns which may cause confusion.

Rename columns to user friendly names. Avoid jargon like Build_Capacity'[RangeSpace].
Also provide the example desired output, with a clear step-by-step description of calculations the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Remember you are gertting free expert help, so please put lots of proper effort to asking questions and providing examples.

Vaugue descriptions can waste your time and our time.

Look forward to helping you when the above information is forthcoming

 

Perhaps you can learn DAX and adapt the logic from this example, which prevents the line dropping below 20% of the max. 

Note how the CALCUALATE use ALL to get the max value.

 

Then the IF returns the actual or base value 

 

Please click thumps up for the helpful suggestions and then [accept solution] if it works.  Thanks

 

 

Answer = 
// Get your actual value
var actualvalue = SUM(yourdata[Amount])

// Get 20% of max value
var base =
CALCULATE( 
    MAX(yourdata[Amount]),  
    ALL(yourdata[Dates])
    ) 
    * 0.20

RETURN
// dont go below the base value
IF(actualvalue < base, base, actualvalue)

 

 

 

speedramps_1-1739109457649.png

 

 

 

 

Thanks for your advice;
using the fix provided I want to utilise the CALCULATE MAX as follows:


Sum Range Space =

varTest = CALCULATE(MAX([SumRangeSpace1], ALL('Date')))
VAR RangeSpaceCount = CALCULATE(COUNT(' Build_Capacity'[RangeSpace]

 

VAR TotalCount =  CALCULATE(DISTINCTCOUNT('Build_Usage'[ID]), ALL('Date'))

VAR BLANKK = BLANK()

RETURN

    IF (

        (

            ISFILTERED ( 'Hs'[House Name] )

                && RangeSpaceCount = TotalCount

        ),

        [SumRangeSpace1],

        BLANK()

    )

The underlying measure [SumRangeSpace1] is

SumRangeSpace1 = CALCULATE (

    SUM( 'Build_Capacity'[RangeSpace] ),

    TREATAS (

        VALUES ( 'Build_Usage'[ID] ),

        'Build_Capacity'[ID]

    )

)

rectified this issue using 
CALCULATE([SumRangeSpace1], ALL('Date'))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.