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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Latest Value

Hi Guys,

 

I need some help on this. Here's my data:

DateStoreProductAnswer
16/07/2018McDonaldPizzaYes
17/07/2018McDonaldPizzaNo
16/07/2018McDonaldBurgerNo
17/07/2018McDonaldBurgerNo
16/07/2018KFCPizzaYes
17/07/2018KFCPizzaYes
16/07/2018KFCBurgerNo
17/07/2018KFCBurgerYes

 

I need to always get the Answer for latest Date. Here what result should be:

DateStoreProductAnswer
17/07/2018McDonaldPizzaNo
17/07/2018McDonaldBurgerNo
17/07/2018KFCPizzaYes
17/07/2018KFCBurgerYes

 

1. Can you please tell me the DAX formula to create above table?

 

2. Can you please tell me what should be the Measure for using Answer in a visualisation?

 

Thanks in advance.

Rob

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my file from here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

@Anonymous

 

As a NEW Table ("Calculated Table"), you can use

 

New Table =
VAR temp =
    ADDCOLUMNS (
        Table1,
        "RANK", RANKX ( FILTER ( Table1, [Store] = EARLIER ( [Store] ) ), [Date],, DESC, DENSE )
    )
RETURN
    FILTER ( temp, [RANK] = 1 )

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my file from here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

Thanks for your help.

 

However, I need a measure that will display the value for Answer in any visualisation. Is that possible?

 

And/or create a new table in DAX that filters the below data only:

DateStoreProductAnswer
17/07/2018McDonaldPizzaNo
17/07/2018McDonaldBurgerNo
17/07/2018KFCPizzaYes
17/07/2018KFCBurgerYes

 

Thanks

Hi,

 

That is what my solution does.  Perhaps i do not understand your requirement.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

Can you please let me know the syntax for producing the below new table in DAX? 

 

Using this feature: new table.PNG

 

DateStoreProductAnswer
17/07/2018McDonaldPizzaNo
17/07/2018McDonaldBurgerNo
17/07/2018KFCPizzaYes
17/07/2018KFCBurgerYes

 

Thank you

@Anonymous

 

As a NEW Table ("Calculated Table"), you can use

 

New Table =
VAR temp =
    ADDCOLUMNS (
        Table1,
        "RANK", RANKX ( FILTER ( Table1, [Store] = EARLIER ( [Store] ) ), [Date],, DESC, DENSE )
    )
RETURN
    FILTER ( temp, [RANK] = 1 )

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.