Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi all,
My problem is a relatively straightfoward one. I have a table that essentially looks like this:
Ref | Date | Value |
1 | 07/09/2022 | |
1 | 03/04/2020 | 2000 |
1 | 06/02/2021 | |
1 | 09/02/2019 | 5000 |
For the value column, some data in rows is blank - however the row needs to be kept as other important info remains in columns not in my example here.
I want to display a table in my report where there are 4 columns:
The first is easy - I just drag the Ref field across to the visual
The second - to take the last value based on date - I already have this -
@julesdude , Not very clear
Create a rank on date
Rank= if(Isblank([Date]), Blank(), Rankx(filter(Table, [Ref] =earlier([Ref]) ), [Date],,asc, dense)
now measure
this ref date = calculate(Sum(Table[Value]), filter(allselected(Table), [Ref] =max([Ref]) && [Rank] =max([Rank]) ))
Last ref date = calculate(Sum(Table[Value]), filter(allselected(Table), [Ref] =max([Ref]) && [Rank] =max([Rank])-1 ))
Hi @amitchandak
Sorry if I was unclear. Is your example still best to use based on the below-hope makes clearer!
Basically I have this table in my data model:
Ref | Date | Value |
1 | 07/09/2022 | |
1 | 03/04/2020 | 2000 |
1 | 06/02/2021 | |
1 | 09/02/2019 | 5000 |
2 | 2018 | 1000 |
2 | 2022 | |
2 | 2021 |
In my report I need it displayed like this:
Ref | CurrentValue | PreviousValue | % Diff |
1 | 2000 | 5000 | [% diff here] |
2 | 1000 | [no % difference if Current Value or previous value blank] |
Logic : find last value and previous value going back in time using the date column, skipping any blanks. If there is only one value found, or if there is no value found, just leave % blank.