This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA 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.
Hi Guys,
I need some help on this. Here's my data:
| Date | Store | Product | Answer |
| 16/07/2018 | McDonald | Pizza | Yes |
| 17/07/2018 | McDonald | Pizza | No |
| 16/07/2018 | McDonald | Burger | No |
| 17/07/2018 | McDonald | Burger | No |
| 16/07/2018 | KFC | Pizza | Yes |
| 17/07/2018 | KFC | Pizza | Yes |
| 16/07/2018 | KFC | Burger | No |
| 17/07/2018 | KFC | Burger | Yes |
I need to always get the Answer for latest Date. Here what result should be:
| Date | Store | Product | Answer |
| 17/07/2018 | McDonald | Pizza | No |
| 17/07/2018 | McDonald | Burger | No |
| 17/07/2018 | KFC | Pizza | Yes |
| 17/07/2018 | KFC | Burger | Yes |
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
Solved! Go to Solution.
Hi,
You may download my file from here.
Hope this helps.
@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 )
Hi,
You may download my file from here.
Hope this helps.
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:
| Date | Store | Product | Answer |
| 17/07/2018 | McDonald | Pizza | No |
| 17/07/2018 | McDonald | Burger | No |
| 17/07/2018 | KFC | Pizza | Yes |
| 17/07/2018 | KFC | Burger | Yes |
Thanks
Hi,
That is what my solution does. Perhaps i do not understand your requirement.
Hi Ashish,
Can you please let me know the syntax for producing the below new table in DAX?
Using this feature:
| Date | Store | Product | Answer |
| 17/07/2018 | McDonald | Pizza | No |
| 17/07/2018 | McDonald | Burger | No |
| 17/07/2018 | KFC | Pizza | Yes |
| 17/07/2018 | KFC | Burger | Yes |
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 )
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 25 | |
| 22 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 50 | |
| 47 | |
| 23 | |
| 18 | |
| 18 |