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
lovishsood1
Helper II
Helper II

Highlight news rows added based on Date

Hello Everyone,

 

I have a table in which data is being stored DATE-wise.

 

I have taken a MATRIX visual and date slicer.

I want to highlight new rows added based on slicer selection.

For example;

lovishsood1_0-1706892861052.png

I have selected 3rd jan to 26th Jan.

lovishsood1_1-1706892944296.png

I want to highlight the 2020 column as it was added on the 26th Jan and it was not present on the 3rd Jan.

 

lovishsood1_2-1706893027428.png

I'm already highlighting duplicate rows. If two values exist for the same country and the same year then it highlights it.

 

 

Measure for above Conditional Formatting:

 

Tooltip_color_Goal-1 = 
var minDate = CALCULATE(Min('Goal 1'[UpdatedFromDate]),ALLSELECTED('Goal 1'[UpdatedFromDate]))
var maxDate = CALCULATE(MAX('Goal 1'[UpdatedFromDate]),ALLSELECTED('Goal 1'[UpdatedFromDate]))
var minValue = CALCULATE(MAX('Goal 1'[Value]),'Goal 1'[UpdatedFromDate]=minDate)
var maxValue = CALCULATE(MAX('Goal 1'[Value]),'Goal 1'[UpdatedFromDate]=maxDate)
//var CreatedDate = IF((SELECTEDVALUE('Goal 1'[Created])>=minDate && //SELECTEDVALUE('Goal 1'[Created])<=maxDate),1,0) 
RETURN
/* SWITCH(TRUE(),minDate=maxDate,0,minValue=maxValue,0,1) */
//IF(CreatedDate=1,1,
IF(minDate=maxDate,0,
IF(minValue=maxValue,0,1))

 

 

I hope my problem is understood.


I want to highlight new rows added based on the SLICER SELECTION.

9 REPLIES 9
bolfri
Super User
Super User

Hi, can you share some sample data to work with? 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




YearValueUpdatedFromDateCountryAbrv
20094.203-01-2024LU
200930.903-01-2024TR
20092.903-01-2024UK
2010403-01-2024AT
20101.903-01-2024BE
20105.703-01-2024EU
202015.326-01-2024AL
20203.226-01-2024SK
202021.926-01-2024TR
2009226-01-2024LU

 

Above sample contains duplicate as well as new data based on DATE.

Hi @lovishsood1 

 

You can try this measure

Tooltip_color_Goal-1 = 
var minDate = CALCULATE(Min('Goal 1'[UpdatedFromDate]),ALLSELECTED('Goal 1'[UpdatedFromDate]))
var maxDate = CALCULATE(MAX('Goal 1'[UpdatedFromDate]),ALLSELECTED('Goal 1'[UpdatedFromDate]))
var minValue = CALCULATE(MAX('Goal 1'[Value]),'Goal 1'[UpdatedFromDate]=minDate)
var maxValue = CALCULATE(MAX('Goal 1'[Value]),'Goal 1'[UpdatedFromDate]=maxDate)
var updatedDate = SELECTEDVALUE('Goal 1'[UpdatedFromDate])
var maxSlicerDate = CALCULATE(MAX('Goal 1'[UpdatedFromDate]),ALL('Goal 1'))
RETURN
IF(updatedDate<maxSlicerDate,
IF(minDate=maxDate,0,
IF(minValue=maxValue,0,1)),
1)

vjingzhanmsft_1-1707209780579.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Nope, It's not making any impact on it.

 

I think, it is because you have used SELECTEDVALUE function which is not applicable on BETWEEN Slicer.

Hi @lovishsood1 

 

I think your real data are more complex so SELECTEDVALUE returns blank when there are multiple dates for the same region and year, which makes it not work. Try replacing SELECTEDVALUE with MAX. If this still doesn't work, could you provide some more dummy data that can represent your data to work with? 

 

Regards,
Jing

How do I share a CSV file here? 

Not able to upload - Neither XLSX Nor PBIX file.

 

Can you please help me out, How can I share more dummy data?

I can only provide 10 x 10 data. But I want to provide more than this.

You can use wetransfer.com to give Us a csv file or even a pbix file with sample data included.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.