Forum Discussion
Not showing duplicates in visual
- 4 years ago
Hi, Anonymous
Latest_Date = var MaxDate = CALCULATE(MAXX(Users,Users[Date]), ALLEXCEPT(Users,Users[USER-ID])) return MaxDateIs this something that would fulfil your request?
Anonymous Hard to be specific without sample data and expected output. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
| TC_ID | Version | Date | IsLatestResult |
| 1 | 23.3 | 10.10.2021 | 0 |
| 1 | 25.3 | 20.10.2021 | 1 |
| 2 | 23.3 | 10.10.2021 | 1 |
| 3 | 24.2 | 15.10.2021 | 1 |
Sorry that I cant show real sample data. But the idea goes like this. Where the IsLatestResult is the Measure. My PieChart should than only show the values that have 1s.
- vojtechsima4 years ago
Super User
Hi, Anonymous,
if you want to use it that way, then here is my solution in calculated column:IsLatestResultCheck = var latestdate = CALCULATE(MAXX('Table','Table'[Date]),ALLEXCEPT('Table','Table'[TC_ID])) var check = if('Table'[Date]=latestdate,1,0) return checkTho, I would prepare my earlier solution, where you would instead of "Date" display just the "New Latest Date", that way you will see only the latest.
Like this:
- Anonymous4 years agoNot applicable
I think this wont work, because I have a lot more versions and results and testcases in my dataset. And in my visual I only want to do this for selected versions nad if I would do a calculated column it would a lot of times filter out the results I want because its not the latest result in total but it would be latest on selection. Yout other solution would suite better if it wouldnt still display all results in my case.
- vojtechsima4 years ago
Super User
Anonymous
I see your point, however, without precise and specific conditions and requirements for the visualisations, I cannot help more.
Tho, you can also create a Calculated Table, with only the Latest Dates, that way you can display the request visualisation.IsLatestResultCheck = var latestdate = CALCULATE(MAXX('Table','Table'[Date]),ALLEXCEPT('Table','Table'[TC_ID])) var MaxedTable = CALCULATETABLE('Table', FILTER('Table','Table'[Date]=latestdate)) return MaxedTable