The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |