Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a data similar to this and i want to find the max ReadingDate for unique facing and product. For example, Cheetos chrunchy max date for facing.1 will be the result table below. This will be repeated for all products available. I want this created as a new column in the data such that i can use this new MaxReadinDate column as my new date field to create a "table visualization" in power bi with the other column of my choice in the new table. These other columns are not included here. Please, i can do this in power query but i prefer this is done in DAX. Thanks for your help.
Data
Desired result
ReadingDate | product | Facing |
7/14/2020 11:19:25 AM | Cheetos Crunchy | 1 |
7/13/2020 1:30:06 PM | Cheetos Crunchy | 2 |
Solved! Go to Solution.
@Anonymous , the second row does not seem correct
You can have formula like
lastnonblankvalue(Table[Date],max(Table([Facing])))
or
lastnonblankvalue(Table[Date],sum(Table([Facing])))
You can use SUMMARIZECOLUMNS to create the table .
Hi @Anonymous ,
Is this problem solved?
If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If not, please let me know.
Best Regards,
Icey
@Anonymous , the second row does not seem correct
You can have formula like
lastnonblankvalue(Table[Date],max(Table([Facing])))
or
lastnonblankvalue(Table[Date],sum(Table([Facing])))
You can use SUMMARIZECOLUMNS to create the table .
CALCULATE(MAX(DateLast[ReadingDate.1]),ALLEXCEPT(DateLast,DateLast[Product1 ],DateLast[Facing.1]))
Try use above dax to create calculated column
Proud to be a Super User!
Thanks for your prompt response, i don't think it likes the code. It created the column but with an error, I t looks to me that the complain is about the "DateLast". My table name is merge.1, at what point does the table name come in, in your code? I ask this because i don't see where it should be included here, I am new to DAX so please pardon me.
It worked but not what i want. After dragging the field to the converse and selected other fields, it threw an error. Remember the reason for this is to be able to drag the field alongside others to create a table visualization. All i want is to have a new column where this MaxDate is extracted so that instead of using the initial ReadingDate.1 field as my date field for the table visualization that i want to create, i would us ethe new MaxDate instead as my date field. Thanks
DateLast is my Table, you should use tablename here instead of DateLast
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |