March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Everyone!
Scenario
Here is my situation. I have a table/view that records every transaction. In Power BI I have aggregated the table to show summary for each day for last 8 days. I have a requirement to compute the growth in total consultations by comparing the total consultation for a specific date for example Sep 7, 2018 to the total consultation on the date which was 1 week before the specific date i.e., Aug 31, 2018
The growth is calculated by the formula:
(Total consultations for current date - Total consultations for Last weeks date)/(Total consultation for last weekdate)
Problem
I can access the current total consultations as it is the current record. But having a hard time trying to access the last week consultations.
What I am looking for is something to let me access the records based on a date condition.
Something that would
1. take current record date - 7 days,
2. use this date as a filter to apply on whole table,
3, get the records that match this date
4. and sum the total consultation for this records.
Now number 2 and 3 are the issue that I am unable to solve. I would apprecitate if anyone can point me in the right direction.
@habibsyed01,
I make a test using the sample table below. And create the following columns.
Index = RANKX(FILTER(Table3,Table3[Date]<EARLIER(Table3[Date])),Table3[Date],,ASC,Dense)
last 7 days value = CALCULATE(SUM(Table3[Value]),FILTER(Table3,Table3[Index]=EARLIER(Table3[Index])-7))
If the above DAX don't help, please share sample data of your table that can be copied and pasted here. Also post expected result in the forum.
Regards,
Lydia
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |