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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
vividarinda
Helper I
Helper I

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

1 ACCEPTED SOLUTION

@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 I
Helper I

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.