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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
vividarinda
Helper II
Helper II

Get value based from same data and remark the value

I currently have data like this, 

vividarinda_0-1711096363270.png

 

But, how can I to set remark high and low based on date?

 

Thanks

2 ACCEPTED SOLUTIONS
Rohit11
Resolver I
Resolver I

Hi @vividarinda 

Try this DAX expression using calculated column, 

 

Calculated Column =

VAR CurrentDate = 'Table'[Date]
VAR MaxValue = CALCULATE(MAX('Table'[Value]), FILTER('Table', 'Table'[Date] = CurrentDate))
VAR MinValue = CALCULATE(MIN('Table'[Value]), FILTER('Table', 'Table'[Date] = CurrentDate))
RETURN
    IF('Table'[Value] = MaxValue, "High", IF('Table'[Value] = MinValue, "Low", BLANK()))
 
Rohit11_0-1711098825450.png

 

 

DAX expression using Measure, 

Measure =

VAR MaxValue = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Date] = MAX('Table'[Date])))
VAR MinValue = CALCULATE(MIN('Table'[Value]), FILTER(ALL('Table'), 'Table'[Date] = MAX('Table'[Date])))
RETURN

    IF(
        SELECTEDVALUE('Table'[Value]) = MaxValue, "High",
            IF(SELECTEDVALUE('Table'[Value]) = MinValue, "Low",BLANK()))
 

Rohit11_0-1711102652413.png

 

Make this setting if you are not able to view measure with blank values . Right click on date and choose show items with no data. 

 

Rohit11_1-1711102725722.png

 



Don't forget to give thumbs up and accept this as a solution if it helped you!!!

 

Thank you, 

 

View solution in original post

@vividarinda 

Thanks for sending over .pbix file.

I've slightly modifed DAX expression for calculated column. 

Try with this updated DAX 


minmax =
VAR CurrentDate = FORMAT(datatkphcontoh[calendar],"m/d/yyyy")
VAR MaxValue = CALCULATE(MAX(datatkphcontoh[TKPH Site]), FILTER(datatkphcontoh, FORMAT(datatkphcontoh[calendar],"m/d/yyyy") = CurrentDate))
VAR MinValue = CALCULATE(MIN(datatkphcontoh[TKPH Site]), FILTER(datatkphcontoh, FORMAT(datatkphcontoh[calendar],"m/d/yyyy") = CurrentDate))
RETURN

    IF(datatkphcontoh[TKPH Site] = MaxValue, "High", IF(datatkphcontoh[TKPH Site] = MinValue, "Low", BLANK()))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

 

Thank you, 

View solution in original post

7 REPLIES 7
Rohit11
Resolver I
Resolver I

@vividarinda , I'm unable to see all columns in the new image you sent , if possible send .pbix file !  

 

Thanks.. 

Hi @Rohit11 , Link here : https://shorturl.at/vALPV

@vividarinda 

Thanks for sending over .pbix file.

I've slightly modifed DAX expression for calculated column. 

Try with this updated DAX 


minmax =
VAR CurrentDate = FORMAT(datatkphcontoh[calendar],"m/d/yyyy")
VAR MaxValue = CALCULATE(MAX(datatkphcontoh[TKPH Site]), FILTER(datatkphcontoh, FORMAT(datatkphcontoh[calendar],"m/d/yyyy") = CurrentDate))
VAR MinValue = CALCULATE(MIN(datatkphcontoh[TKPH Site]), FILTER(datatkphcontoh, FORMAT(datatkphcontoh[calendar],"m/d/yyyy") = CurrentDate))
RETURN

    IF(datatkphcontoh[TKPH Site] = MaxValue, "High", IF(datatkphcontoh[TKPH Site] = MinValue, "Low", BLANK()))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

 

Thank you, 

 

@vividarinda Great !! Please accept this as a solution if it helped you!!!

Hi @Rohit11 ,

Thanks a lot. It works 😁

vividarinda
Helper II
Helper II

Hi @Rohit11 ,

Thanks for your feedback. But in my row data display result like this, in the same date. Could you help me?

vividarinda_0-1711337475556.png

 

Vivid

Rohit11
Resolver I
Resolver I

Hi @vividarinda 

Try this DAX expression using calculated column, 

 

Calculated Column =

VAR CurrentDate = 'Table'[Date]
VAR MaxValue = CALCULATE(MAX('Table'[Value]), FILTER('Table', 'Table'[Date] = CurrentDate))
VAR MinValue = CALCULATE(MIN('Table'[Value]), FILTER('Table', 'Table'[Date] = CurrentDate))
RETURN
    IF('Table'[Value] = MaxValue, "High", IF('Table'[Value] = MinValue, "Low", BLANK()))
 
Rohit11_0-1711098825450.png

 

 

DAX expression using Measure, 

Measure =

VAR MaxValue = CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), 'Table'[Date] = MAX('Table'[Date])))
VAR MinValue = CALCULATE(MIN('Table'[Value]), FILTER(ALL('Table'), 'Table'[Date] = MAX('Table'[Date])))
RETURN

    IF(
        SELECTEDVALUE('Table'[Value]) = MaxValue, "High",
            IF(SELECTEDVALUE('Table'[Value]) = MinValue, "Low",BLANK()))
 

Rohit11_0-1711102652413.png

 

Make this setting if you are not able to view measure with blank values . Right click on date and choose show items with no data. 

 

Rohit11_1-1711102725722.png

 



Don't forget to give thumbs up and accept this as a solution if it helped you!!!

 

Thank you, 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.