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.
Hi All,
I want to Pick To Date only which I have highlight below using dax and As I am using Date ranges as well
Solved! Go to Solution.
Hi,
Try the following dax formula.
Previous year = CALCULATE(SUM('Table'[Sales]), FILTER(ALL('Table'), 'Table'[Date] <= MAX('Table'[Date]) && 'Table'[Year] = YEAR(TODAY())))
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @aamirkhan_WT ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the measure to get the To date and from date.
To Date = MAX('Table'[Date])
From Date = MIN('Table'[Date])
3.Drag the measure into the card visual.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes but how to calculate Previous period and Previous Year sales from To Date selection. if you show me in the same pbi file
Hi @aamirkhan_WT ,
Please try the following methods:
1.Create the sample table.
2.Create the new measure to calculate previous period and previous year.
Previous year = CALCULATE(SUM('Table'[Sales]), FILTER(ALL('Table'), 'Table'[Year] = YEAR(MAX('Table'[Date])) - 1))
Previous preiod = CALCULATE(SUM('Table'[Sales]), DATESBETWEEN('Table'[Date], MIN('Table'[Date]), MAX('Table'[Date])))
3.Drag the measures into the card visual. Select the to date.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
this Dax is considering From date or base on To Date as I need to work from To Data only
Previous preiod = CALCULATE(SUM('Table'[Sales]), DATESBETWEEN('Table'[Date], MIN('Table'[Date]), MAX('Table'[Date])))
Hi,
Try the following dax formula.
Previous year = CALCULATE(SUM('Table'[Sales]), FILTER(ALL('Table'), 'Table'[Date] <= MAX('Table'[Date]) && 'Table'[Year] = YEAR(TODAY())))
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @aamirkhan_WT
You mean, you want to get the max date?
MAX(YourDateTable[Date]) - Should do the work
Proud to be a Super User!
If I select date from date range which I have highlight (To Date) for example 3/31/2024 or 3/21/2024 and from Date if it select 1/31/2024 which is fixed will it show 3 months using Dax
Hi,
It would be really helpful if you write your query property. it is not clear what you exactly want to achieve.
Thanks,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |