The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Good day,
Please suggest how to compare data (text field) yesterday Vs today
CounterpartyId | Price | Reference | Date | |
1 | 10 | 123ade | 23/01/2019 | |
2 | 23 | red123 | 23/01/2019 | |
1 | 23 | 456kkk | 24/01/2019 | |
2 | 54 | red123 | 24/01/2019 | |
3 | 65 | mln321 | 24/01/2019 | |
1 | 10 | 888lk | 25/01/2019 | |
2 | 23 | 090mln | 25/01/2019 | |
3 | 33 | mln321 | 25/01/2019 | |
4 | 43 | 909jkj | 25/01/2019 |
I would like to compare "Reference" column Yesterday Vs Today based on Date filter slicer
I am expecting: When i select 24/01/2019, Calculated Column should show "Reference" values of previous day (23/01/2019)
Please help me out by providing DAX.
Thank you
@Anonymous Please create a measure as per below
Measure =
VAR _selectedDate = SELECTEDVALUE('Table'[Date])
VAR _prevdate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'[Date]),'Table'[Date]<_selectedDate))
RETURN CALCULATE(MAX('Table'[Reference]),FILTER(ALLEXCEPT('Table','Table'[CounterpartyId]),'Table'[Date]=_prevdate))
This will give you CounterpartyId wise previous date reference
Thank you so much.
I have applied DAX and it has returned nothing.
Thank you
@Anonymous Sorry I missed one argument in allexcept function.
Measure =
VAR _selectedDate = SELECTEDVALUE('Table'[Date])
VAR _prevdate = CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[CounterpartyId]),'Table'[Date]<_selectedDate))
RETURN CALCULATE(MAX('Table'[Reference]),FILTER(ALLEXCEPT('Table','Table'[CounterpartyId]),'Table'[Date]=_prevdate))
Please create a measure as per above dax
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |