The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a table with the key field (CHAVE), values and dates.
I would like an expression to add only the unique records based on the most recent date.
and in the end I would like to be able to add a table as follows:
AAA 10
BBB 30
CCC 40
XXX 10
YYY 40
ZZZ 90
total 220
Hi @Anonymous ,
Try this measure.
Last Value = LASTNONBLANKVALUE('Table'[DATA],MAX('Table'[Peso]))
Regards,
Harsh Nathani
Please try this measure expression, replacing Table with your actual table name.
Sum of Latest Values =
VAR summary =
ADDCOLUMNS (
VALUES ( Table[CHAVE] ),
"@value", CALCULATE ( LASTNONBLANKVALUE ( Table[Date], MAX ( Table[Peso] ) ) )
)
RETURN
SUMX ( summary, [@value] )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Does it have to be in DAX, and can you provide the sample data in usable form?
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |