Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello PBI Comunity,
I am trying to solve the following criteria:[Latest name] is my target DAX column.
I need to check if a name is duplicate, then check all the dates for that name, only the latest date will get 1 in the target column. The rest will have 0
Note: If the name has multiple dates like alice, only one date have to get 1.
This is my data set https://drive.google.com/file/d/1n6xIE5fXunz1hMsE1po6INoc0aAQRTtN/view?usp=sharing
TIA,
Sri
Step 1: In Power Query, sort the data by name first and then date
2. Group the data by name. Use 'All rows' as the new column.
3. Add an Index to each grouping of name with:
Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([All], "Ind", 1, 1))
4. Expand the Index column and remove the ALL column. You should get this:
5. a) You can add the column in Power Query (I'll leave you to figure that one out) OR
b) Use this DAX
Column = IF(CALCULATE(MAX(dataNames[Custom.Ind]), ALLEXCEPT(dataNames,dataNames[name])) = dataNames[Custom.Ind], 1, 0)
Hello @HotChilli ,
I appreciate your response!
However, I cannot do this in the query editor, I have many columns unlike the sample data
Is there a way to do this in DAX without the help of query editor?
Thanks,
Sri
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
14 | |
11 | |
7 |