Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello all, please complete or correct my DAX expression for the following expression:
If today is Saturday calculate total sales between 5 days ago and 1 day ago from today.
Total for the week based on the selected date by date slicer
Hi,
The general pattern is as follows:
=calculate(sum(Sales[Sales$]),datesbetween('Date'[Date],min(calendar[date])-5,min(calendar[date])-1))
Hi Ashish, we want date between 5 days earlier today and 1 day earlier today. Why you used min expression?
Because i want to capture the value of the Date. I assume that you have dragged date (from the Calendar table) to the Table visual
What is the output of the min(calendar[date]? Would it be today?
No. Assuming you have dragged dates from the Calendar Table to the Table visual, it will simply give the Date value. The MIN() can be replaced with MAX as well. You may want to share some data and show the expected result.
User | Count |
---|---|
84 | |
78 | |
70 | |
49 | |
41 |
User | Count |
---|---|
111 | |
56 | |
50 | |
42 | |
40 |