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
So I have the following type of data:
Location | Date | Case Count | Earliest Date |
A | 1/1/2020 | 0 | |
A | 1/2/2020 | 3 | 1/2/2020 |
A | 1/3/2020 | 10 | 1/3/2020 |
B | 1/1/2020 | 0 | |
B | 1/2/2020 | 0 | |
B | 1/3/2020 | 1 | 1/3/2020 |
B | 1/4/2020 | 8 | 1/4/2020 |
I want to show the earliest date and not have it change: This is the code I used to calculate the earliest date:
Location | Date | Case Count | Earliest Date | Change in Count |
A | 1/1/2020 | 0 | -- | |
A | 1/2/2020 | 3 | 1/2/2020 | 3 |
A | 1/3/2020 | 10 | 1/2/2020 | 7 |
B | 1/1/2020 | 0 | -- | |
B | 1/2/2020 | 0 | -- | |
B | 1/3/2020 | 1 | 1/3/2020 | 1 |
B | 1/4/2020 | 8 | 1/3/2020 | 7 |
Solved! Go to Solution.
Hi @william_johnson ,
You may create measures like DAX below.
Earliest Date = CALCULATE( MIN('Table'[Date]), FILTER(ALLEXCEPT('Table', 'Table'[Location]), 'Table'[Case Count] > 0 &&'Table'[Date] <= MAX('Table'[Date])))
Change in Count = Var d= CALCULATE(SUM('Table'[Case Count]),FILTER(ALLEXCEPT('Table','Table'[Location]),'Table'[Date]=[Earliest Date]))
return
IF(MAX('Table'[Case Count])<>0, IF(MAX('Table'[Date])=[Earliest Date],d , SUM('Table'[Case Count])-d))
Result:
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @william_johnson ,
You may create measures like DAX below.
Earliest Date = CALCULATE( MIN('Table'[Date]), FILTER(ALLEXCEPT('Table', 'Table'[Location]), 'Table'[Case Count] > 0 &&'Table'[Date] <= MAX('Table'[Date])))
Change in Count = Var d= CALCULATE(SUM('Table'[Case Count]),FILTER(ALLEXCEPT('Table','Table'[Location]),'Table'[Date]=[Earliest Date]))
return
IF(MAX('Table'[Case Count])<>0, IF(MAX('Table'[Date])=[Earliest Date],d , SUM('Table'[Case Count])-d))
Result:
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @william_johnson ,
Please share the expected output. It will help provide a fastr resolution.
Regards,
Harsh Nathani
Thanks, changed! First time post, I'm a newbie!
Hi @william_johnson ,
Thanks a lot. Here you go.
Create Calculated Columns
The demoted case only returns an answer of 1 rather than the actual number of cases on day 2 minus the number of cases on day 1 by location, and so-on.
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 |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |