Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have one table visual that contains:
My data contains sales from June/2022 - Dec 2023. Currently Im filtering the visual on all the months in 2023.
Question: I want to add one extra column that is the sum of sales in all the past months (June/2022- Feb/2023)- call this past period.
How do we do this? and ideally dynamically?
TIA!
Solved! Go to Solution.
Hi @Kinsley ,
Based on your description, I have created a simple sample:
Please try:
First add a new column:
Period =
var _a = FORMAT([Date],"MMM-YY")
return IF([Date]>=DATE(2022,6,1)&&[Date]<=DATE(2023,2,28),"Past Period",_a)
Sort = IF([Date]<=DATE(2023,2,28),1,MONTH([Date]))
Output:
Then Sort the[Period] column by [Sort] column:
Apply it to the matrix visual:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Kinsley ,
Based on your description, I have created a simple sample:
Please try:
First add a new column:
Period =
var _a = FORMAT([Date],"MMM-YY")
return IF([Date]>=DATE(2022,6,1)&&[Date]<=DATE(2023,2,28),"Past Period",_a)
Sort = IF([Date]<=DATE(2023,2,28),1,MONTH([Date]))
Output:
Then Sort the[Period] column by [Sort] column:
Apply it to the matrix visual:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
5 | |
4 | |
4 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
4 | |
4 | |
4 |