Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello everyone,
Can you help me figure out how I can achieve the following in DAX ?
==> I want to pick up the last Customer Name value and have it applied to the whole dimension.
The name of this measure will be named Current Customer Name as opposed to the "Historical Customer Name":
Example:
Date Cust Nbr Cust Name Current Cust Name
Jan 1 1234 World Inc World Corp
Jan 2 1234 World Inc World Corp
Jan 3 1234 World Corp World Corp
Jan 4 1234 World Corp World Corp
Jan 5 1234 World Corp World Corp
Thanks in advance.
Jason
Solved! Go to Solution.
@Anonymous
You can try below codng to see if this can solve your problem. Thanks
Column = VAR maxdate=MAXX(FILTER('Sheet14',Sheet14[customernumber]=EARLIER(Sheet14[customernumber])),'Sheet14'[date]) return MAXX(FILTER('Sheet14',Sheet14[customernumber]=EARLIER(Sheet14[customernumber])&&'Sheet14'[date]=maxdate),Sheet14[name])
Proud to be a Super User!
@Anonymous
You can try below codng to see if this can solve your problem. Thanks
Column = VAR maxdate=MAXX(FILTER('Sheet14',Sheet14[customernumber]=EARLIER(Sheet14[customernumber])),'Sheet14'[date]) return MAXX(FILTER('Sheet14',Sheet14[customernumber]=EARLIER(Sheet14[customernumber])&&'Sheet14'[date]=maxdate),Sheet14[name])
Proud to be a Super User!
This is amazing !
It works.
Just a question, why does it have to be a column and not a measure ?
Thanks,
Jason.
@Anonymous
You are welcome. The first formula came out of my mind to solve this kind of problem is Eariler. Earlier can only be used in column calculation. Maybe others can do that in measure. However, I am also new to PBI. My knowledge is still limited and I am also learning DAX. 🙂
Proud to be a Super User!
User | Count |
---|---|
85 | |
84 | |
71 | |
65 | |
57 |
User | Count |
---|---|
129 | |
102 | |
91 | |
83 | |
67 |