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.
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
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 |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |