Forum Discussion
Refresh column in a table
Hi all,
I don't know if I'm on the right way but maybe you can give me some advices...
I have two identical tables (Tab1 and Tab2 like):
| ID | Date | Text |
| 1 | 25.07.2021 | Text_1 |
| 2 | 25.07.2021 | Text_2 |
| 1 | 26.07.2021 | Text_NewId_1 |
| 2 | 26.07.2021 | Text_2 |
I want to show up the Text difference between two dates. I created two slicer (Dropdown) to select a Date from Tab1 and the other from Tab2. I have also created for each a measure to figure out the selected date like:
SelectedDate = SELECTEDVALUE(Tab1[Date],MIN(Tab1[Date])
I added a column in Tab2 with the following:
TextFromTab1 = LOOKUPVALUE(Tab1[Text],Tab1[Date],SelectedDate,Tab1[ID],Tab2[ID])
The formel above is working, but when I change the Date in the slicer, the values in the column are not updated...
Can I refresh the column when the slicer is changed or do I need to create for this kind of problem a measure?
If I need to go over measure, can you make me an example?
Thank you for your help/support
3 Replies
- selimovdMost Valuable Professional
Hey flownfluid ,
calculated columns are always static. When the data model is loaded, the values of the column are created. Then they won't change anymore, for example when you change a slicer.
So this approach won't work. But you can try to modify that column into a measure as measures are dynamic and change with every change of a filter.
Depending on your data LOOKUPVALUE might not work if there are multiple values, but it could also work as a measure.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic- flownfluidFrequent Visitor
Hey Selimovd,
thank you for your explenation.
I created the following measure:
TextFromList1 = VAR l_SelectDateTab1= SELECTEDVALUE(Tab1[Date],MIN(Tab1[Date])) RETURN LOOKUPVALUE( Tab1[Text], Tab1[Date], l_SelectDateTab1, Tab1[ID], FIRSTNONBLANK(Tab2[ID],1) )It looks like that this measure works and shows me also the right text.
But when I create the next measure with a simple if, then something goes wrong:
MatchText = var TextList2 = FIRSTNONBLANK(Tab2[Text],1) RETURN IF(TextList2 = [TextFromList1],1,0)Can you explain me, what is wrong or why it is not working?
General: The ID is unique for a specific day
Thank you for your help
- v-easonf-msftCommunity Support
Hi, flownfluid
Your formula works well on my side.
Can you share relevant screenshots and expected result to explain your current problem?Best Regards,
Community Support Team _ Eason