Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi there,
I need you to please help me with this, I'm trying to create a Viz to compare total services pending in the next 6 month starting from today. I need to compare this result with the same period in previous years.
In my example, Today is Nov/07th, the result listed in the screenshot are from today till the end of the next 6 month. I need to put these 3 results in one sigle table to create a viz and compare performance.
Data is updated in daily basis
Please find the sample in this link
Solved! Go to Solution.
Hi @dustdaniel
You can create measures for each of the three time periods and then put them into the same visual.
1. Create these following measures:
TotalReservas_Current =
VAR StartDate = TODAY()
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < TODAY()
)
TotalReservas_LastYear =
VAR StartDate = EDATE(TODAY(), -12)
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < EDATE(TODAY(), -12)
)
TotalReservas_TwoYearsAgo =
VAR StartDate = EDATE(TODAY(), -24)
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < EDATE(TODAY(), -24)
)
2. Create a table visual and put DateTable[Calendar month] and these three measures into it.
The result is shown below, the current TODAY() function returns 2024/11/12.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dustdaniel
You can create measures for each of the three time periods and then put them into the same visual.
1. Create these following measures:
TotalReservas_Current =
VAR StartDate = TODAY()
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < TODAY()
)
TotalReservas_LastYear =
VAR StartDate = EDATE(TODAY(), -12)
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < EDATE(TODAY(), -12)
)
TotalReservas_TwoYearsAgo =
VAR StartDate = EDATE(TODAY(), -24)
VAR EndDate = EDATE(StartDate, 6)
RETURN
CALCULATE(
[Total ReservasS],
Reserv[PickupDate] >= StartDate,
Reserv[PickupDate] <= EndDate,
Reserv[CreationDate] < EDATE(TODAY(), -24)
)
2. Create a table visual and put DateTable[Calendar month] and these three measures into it.
The result is shown below, the current TODAY() function returns 2024/11/12.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
85 | |
84 | |
73 | |
49 |
User | Count |
---|---|
142 | |
133 | |
110 | |
68 | |
55 |