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.
Hello community!
I'm struggling with a measure and would appreciate if anyone could help!
Here's what I'm trying to do:
I have a physical table of sales amount by employee by date like this:
Name | Amount | Date
John | 500 | 10/04/21
Amanda | 700 | 12/04/21
John | 400 | 15/04/21
I want to create a measure (no custom column allowed since I'm using a shared dataset) where, for each employee, I'll get the first date where they achieved cumulative 600 or more in sales. For Amanda, the result would be 12/04/21. For John, the result would be 15/04/21.
I tried creating a virtual table using SUMMARIZE with the cumulative sum and getting the first date in this table but it doesn't work.
Thanks in advance!
Solved! Go to Solution.
please try this
Measure =
VAR tbl=ADDCOLUMNS('Table (2)',"ytdamount",sumx(FILTER('Table (2)','Table (2)'[name]=EARLIER('Table (2)'[name])&&'Table (2)'[date]<=EARLIER('Table (2)'[date])),'Table (2)'[amount]))
return MINX(FILTER(tbl,[ytdamount]>600),'Table (2)'[date])
please see the attachment below
Proud to be a Super User!
please try this
Measure =
VAR tbl=ADDCOLUMNS('Table (2)',"ytdamount",sumx(FILTER('Table (2)','Table (2)'[name]=EARLIER('Table (2)'[name])&&'Table (2)'[date]<=EARLIER('Table (2)'[date])),'Table (2)'[amount]))
return MINX(FILTER(tbl,[ytdamount]>600),'Table (2)'[date])
please see the attachment below
Proud to be a Super User!
That's it! Thank you very much! I had no idea we could set a virtual table to a variable.
you are welcome
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 |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |