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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NPK
Frequent Visitor

Comparing previous month value to next month on available months only

Hi

my data is as follows

test.png

i want to tshow the arrow marks depending on the available dates in the date column only. the dates are not continues. how can i create a measure to insert the arrow marks in the new column.

 

Thanks

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi NPK,

 

You can use DAX formula like below:

 

Mark =

var preDate = CALCULATE(MAX(Table1[Date]), FILTER(ALL(Table1), Table1[Product Name] = EARLIER(Table1[Product Name]) && Table1[Date] < EARLIER(Table1[Date])))

var preResult = CALCULATE(MAX(Table1[Result]), FILTER(ALL(Table1), Table1[Product Name] = EARLIER(Table1[Product Name]) && Table1[Date] = preDate))

return

IF(preResult <> BLANK(), IF(Table1[Result] > preResult, UNICHAR(9650), UNICHAR(9660)))

1.PNG

 

You can refer to PBIX here:

https://www.dropbox.com/s/2n90rdatt9vgozv/For%20KingsleyZ.pbix?dl=0

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi NPK,

 

You can use DAX formula like below:

 

Mark =

var preDate = CALCULATE(MAX(Table1[Date]), FILTER(ALL(Table1), Table1[Product Name] = EARLIER(Table1[Product Name]) && Table1[Date] < EARLIER(Table1[Date])))

var preResult = CALCULATE(MAX(Table1[Result]), FILTER(ALL(Table1), Table1[Product Name] = EARLIER(Table1[Product Name]) && Table1[Date] = preDate))

return

IF(preResult <> BLANK(), IF(Table1[Result] > preResult, UNICHAR(9650), UNICHAR(9660)))

1.PNG

 

You can refer to PBIX here:

https://www.dropbox.com/s/2n90rdatt9vgozv/For%20KingsleyZ.pbix?dl=0

 

Regards,

Jimmy Tao

Thanks Jimmy Tao, your soluton helped me to solve the problem.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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