cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NPK Frequent Visitor
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

Accepted Solutions
Community Support Team
Community Support Team

Re: Comparing previous month value to next month on available months only

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

2 REPLIES 2
Community Support Team
Community Support Team

Re: Comparing previous month value to next month on available months only

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

NPK Frequent Visitor
Frequent Visitor

Re: Comparing previous month value to next month on available months only

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

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 47 members 1,325 guests
Please welcome our newest community members: