March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi everybody
I want to create a measure that give me QUARTERL SALES, for example:
SALES1 = JAN, FEB, MAR (IN MARCH)
SALES2 = FEB, MAR, APR (IN APRIL)
SALES3 = MAR, APR, MAY (IN MAY)
SALES4 = APR, MAY, JUN (IN JUNE)
SALES 5 = MAY, JUN, JUL (IN JULY)
.
.
.
I tried this:
VAR Date1= Max(Calendar[Date])
VAR Date2 = Date1 - 1
VAR Date3 = Date1 - 2
RETURN CALCULATE([Sales];Calendar[Date]=Date1) + CALCULATE([Sales];Calendar[Date]=Date2) + CALCULATE([Sales];Calendar[Date]=Date3)
But I did not make it. I was learning using DAX
Solved! Go to Solution.
Hello @Anonymous ,
Try this:
Qtr Sum2 =
VAR _StartMonth =
MAX(Calendar[Date])
VAR _QtrSum =
CALCULATE(
[Sales],
DATESINPERIOD(Calendar[Date],_StartMonth,-3,MONTH)
)
RETURN
_QtrSum
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
Hello @Anonymous ,
Try this:
Qtr Sum2 =
VAR _StartMonth =
MAX(Calendar[Date])
VAR _QtrSum =
CALCULATE(
[Sales],
DATESINPERIOD(Calendar[Date],_StartMonth,-3,MONTH)
)
RETURN
_QtrSum
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
The measure works very well!! Eres un crack !!!
Share the result:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
62 | |
28 | |
25 | |
22 | |
17 |