Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Friends,
I have a date column with dates starting from 27-OCT-2014 to current. I have created a column chart which displays the data on contract year basis.
For example:
Contract year 1 has dates from 27-OCT-2014 to 26-oct-2017.
contract year 2 has dates from 27-oct-2017 to 26-oct-2020 and follows the same for the years to come.
I have created a running total measure which is currently giving me the total of the entire table including the contract year 2. Instead, I would like to create a measure which calculates the running total starting from 27-oct-2017 and upcoming months(as I have entered the year 2 not including year 1).
Additionally, I would aslo like to create a measure to calculate projected running totals for the contract year 2 (i.e. 62000/month).
Here are my measures:
Running totals:
Contract year2 Totals =
CALCULATE (
FILTER (
ALL (TokenRecords[UsageDate]),
TokenRecords[UsageDate] >= DATE (10,27,2017 )
&& TokenRecords[UsageDate] <= MAX (TokenRecords[UsageDate])
)
)
Projected totals:
Projected Totals =
COUNTROWS (
SUMMARIZE ( TokenRecords, TokenRecords[FiscalYear], TokenRecords[FiscalMonth]))*62891
Any help would be very much appreciated.
Thank you.
Solved! Go to Solution.
Hi @Rck7,
Try this
=CALCULATE(SUM(Tokenrecords[amount]),DATESBETWEEN(Calendar[Date],DATE(2017,10,1),TODAY()))
I have assumed that you have a table named calendar with running dates. There is a relationship from the Date column of the TokenRecords table to the Date column of the Calendar table.
Hope this helps.
I have Table like
Date , Dayof week (Sunday, Monday etc), Region(East, West, Central), CallCount
I want to calulate MTD AVG_CallCount by Dayof the week For that region & YTD AVG_CallCount by Dayof the week For that region
Example , MTD monday Avg for 2/11
02/11/2018 is the 2nd monday of Feb and 7th Monday of the year.
Now I want to calculate AVG call count for all the Monday till 2/11/2018 (including 2/11) for February , 2/5 & 2/11, for MTD
& AVG call count for all the Monday till 2/11/2018 (including 2/11) for 2018 , for YTD.
Date | WeekofDay | Region | CallCount | Avg_MTD_Weekoftheday |
1/1/2018 | Monday | Central | 100 | 100 |
1/1/2018 | Monday | East | 200 | 200 |
1/1/2018 | Monday | West | 300 | 300 |
1/2/2018 | Tuesday | Central | 150 | 150 |
1/2/2018 | Tuesday | East | 250 | 250 |
1/2/2018 | Tuesday | West | 350 | 350 |
1/3/2018 | Wednesday | Central | ||
1/3/2018 | Wednesday | East | ||
1/3/2018 | Wednesday | West | ||
1/4/2018 | Thursday | Central | ||
1/4/2018 | Thrusday | East | ||
1/4/2018 | Thrusday | West | ||
1/5/2018 | Friday | Central | ||
1/5/2018 | Friday | East | ||
1/5/2018 | Friday | West | ||
1/6/2018 | Saturday | Central | ||
1/6/2018 | Saturday | East | ||
1/6/2018 | Saturday | West | ||
1/7/2018 | Sunday | Central | ||
1/7/2018 | Sunday | East | ||
1/7/2018 | Sunday | West | ||
1/8/2018 | Monday | Central | 200 | 150 |
1/8/2018 | Monday | East | 100 | 150 |
1/8/2018 | Monday | West | 50 | 175 |
1/9/2018 | Tuesday | Central | 100 | |
1/9/2018 | Tuesday | East | 200 | 225 |
1/9/2018 | Tuesday | West | 300 |
Hi,
Why have you left the other cells in the Avg_MTD_Weekoftheday empty? Is tha intentional or is there a logic for them to be left empty?
I Want to calculate that field as I mentioned. I just gave couple of example what the answer to that field look like.
EG, Monday MTD Avg or Monday YTD Avg.
For the first week of the month it will be same as CallCount, From second week it will start calculating that field , AVG of Current monday and previous mondays.
Hi,
Enter this calculated field formula
=if(ISBLANK(Data[CallCount]),BLANK(),CALCULATE(AVERAGE(Data[CallCount]),FILTER(Data,Data[WeekofDay]=EARLIER(Data[WeekofDay])&&Data[Region]=EARLIER(Data[Region])&&Data[Date]<=EARLIER(Data[Date]))))
It gives this error:
EARLIER/EARLIEST refers to an earlier row context which doesn't exist.
Hi @Rck7,
Here are a few fallacies:
Explain the business problem, paste some data and show the expected result.
@Ashish_Mathur Hi. I am trying to build a dashboard showing data on a contract year basis. i.e. (CY1 is from 27/OCT/2014- 26/OCT/2017) which just ended. Now, I have started adding data for CY2 starting (27/OCT/2017- 26/OCT/2020) & follows the same for the years to come.
I have created a single datatable for my dashboard with a usage date column & a value column where I update on a biweekly basis.
Issue:
I created a card on my dashboard which shows the running totals of current contract year for the chart displayed on my dashboard. The problem is that currently my card is displaying the running total value of all the dates available in the usagedate column(i.e. Contract Year 1 + Contract year 2). Instead, I want the card to display the running total starting from 27/OCT/2017.
Please suggest me a measure where I could display the running totals just for CY2 as it is the current year data that i am displaying in my dashboard.
Here is what i am getting:
My measure is adding up all the CY1 & CY2 data from my usage date table(i.e. CY1: 1882898 + CY2: 76570)
Istead the Value should be 76570(starting 27/OCT/2017) as of today.
Kindly help!!!
Thank you.
Hi @Rck7,
Try this
=CALCULATE(SUM(Tokenrecords[amount]),DATESBETWEEN(Calendar[Date],DATE(2017,10,1),TODAY()))
I have assumed that you have a table named calendar with running dates. There is a relationship from the Date column of the TokenRecords table to the Date column of the Calendar table.
Hope this helps.
Hey,
sorry, but I dont understand what you want 🙂
Greetings.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |