Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
HI Experts ,
here i need dax function :
if Date is Greater than 15th of this Month i need to display the data of all the month's data till last month and Less than 15th of the Month means i need to display all the month data except last month .
any one know this formula or method let me know .
Advance Thanks
Thanks
sandeep
Solved! Go to Solution.
Hi,
Try this
=CALCULATE(SUM(Data[Sales]),DATESBETWEEN(Calendar[Date],DATE(YEAR(MIN(Calendar[Date])),1,1),IF(DAY(MIN(Calendar[Date]))<15,EOMONTH(MIN(Calendar[Date]),-2),EOMONTH(MIN(Calendar[Date]),-1))))
Hope this helps.
Hi,
Could you show your expected result. In a simple table, what do you want to see in the row labels/column labels and in the value area section.
Hi
My Output is like in below pic.
this is the output of the i want to display ie
if i selected date is march 14th then output should be the sum(sales) for the month of January.
if i selected date is march 16th then output should be the sum(sales) for the month of January+ Sum(sales) for month of february.
Thanks
sandeep
Hi,
Try this
=CALCULATE(SUM(Data[Sales]),DATESBETWEEN(Calendar[Date],DATE(YEAR(MIN(Calendar[Date])),1,1),IF(DAY(MIN(Calendar[Date]))<15,EOMONTH(MIN(Calendar[Date]),-2),EOMONTH(MIN(Calendar[Date]),-1))))
Hope this helps.
Hi @Ashish_Mathur,
With reference to your post, could you tell me what point number 4 and 5 are saying? . I guessing 5 is to create a measure. But i wasnt clear with 4. Does that mean we just select a value in list date slicer.
Thanks
Aj
Hi,
Yes. Just select one date in the date slicer.
hi!
i too have the same problem but not to display between the date need to display the sale of start date as one column and end date sales as one column
Please confirm if the Date you're mentioning is the max date in your dataset or do you need a column which cumulatively sums up the sale for for every record.
you could use something like
DAX = var MaxDate = max(date) var startdate = Date(Year(maxDate),"01","01") return if (day(maxDate)<=15, Calculate(sum(sales), filter(table,datebetween(date,startdate,EOMONTH(maxDate,-2)))), Calculate(sum(sales), filter(table,datebetween(date,startdate,EOMONTH(maxDate,-1)))) )
Assuming you want the sum of only 1 year. You can change this by setting the StartDate.
Also assumed for the date of 15th of every month you want the result to be the same as 14th.
Let me know if that works out
User | Count |
---|---|
119 | |
78 | |
58 | |
52 | |
46 |
User | Count |
---|---|
170 | |
117 | |
63 | |
58 | |
51 |