Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Experts
How would you do a summarised table and or a measure and or calculated column to give you the last purchased date each month based on the customer in first column
Customer | Date |
abc | 01/01/2022 |
abc | 27/01/2022 |
abc | 02/03/2022 |
abc | 22/03/2022 |
abc | 03/06/2022 |
abc | 22/06/2022 |
ddd | 01/01/2022 |
ddd | 27/01/2022 |
ddd | 02/03/2022 |
ddd | 22/03/2022 |
ddd | 03/06/2022 |
ddd | 22/06/2022 |
Solved! Go to Solution.
@Anonymous Please create a column with below code:-
Column =
VAR _mon =
MONTH ( [Date] )
VAR _year =
YEAR ( [Date] )
RETURN
CALCULATE (
MAX ( [Date] ),
FILTER (
ALL ( 'Table (7)' ),
MONTH ( [Date] ) = MONTH ( EARLIER ( 'Table (7)'[Date] ) )
&& YEAR ( [Date] ) = YEAR ( EARLIER ( 'Table (7)'[Date] ) )
&& 'Table (7)'[Customer] = EARLIER ( 'Table (7)'[Customer] )
)
)
Now use this column on your visual
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous ,
You can create a measure like below:-
_measure =
CALCULATE (
MAX ( 'Table (7)'[Date] ),
FILTER (
ALL ( 'Table (7)'[Date] ),
MONTH ( 'Table (7)'[Date] ) = MONTH ( SELECTEDVALUE ( 'Table (7)'[Date] ) )
&& YEAR ( 'Table (7)'[Date] ) = YEAR ( SELECTEDVALUE ( 'Table (7)'[Date] ) )
)
)
Output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi Samarth - I just want to show the max date for each month - Not all the data.... please..
end result
Customer | Date |
abc | 27/01/2022 |
abc | 22/03/2022 |
abc | 22/06/2022 |
ddd | 27/01/2022 |
ddd | 22/03/2022 |
ddd | 22/06/2022 |
@Anonymous Please create a column with below code:-
Column =
VAR _mon =
MONTH ( [Date] )
VAR _year =
YEAR ( [Date] )
RETURN
CALCULATE (
MAX ( [Date] ),
FILTER (
ALL ( 'Table (7)' ),
MONTH ( [Date] ) = MONTH ( EARLIER ( 'Table (7)'[Date] ) )
&& YEAR ( [Date] ) = YEAR ( EARLIER ( 'Table (7)'[Date] ) )
&& 'Table (7)'[Customer] = EARLIER ( 'Table (7)'[Customer] )
)
)
Now use this column on your visual
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous It would be very helpful if you could share the snapshot of expected output?
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous
Can you try the following as a new table. Apologies, am on phone so can't test syntax.
Table =
SUMMARIZE ( 'Table', 'Table'[Customer], "MaxDate", MAX ( 'Table'[Date] ) )
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
@Anonymous did you try my solution?
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
122 | |
76 | |
71 | |
57 | |
49 |
User | Count |
---|---|
163 | |
84 | |
67 | |
67 | |
60 |