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.
Hello,
I Have a table of invoices to that was submitted to the health insurance company that looks similar to this:
Invoice No. | Mode (1- submission, 2- Resubmissition, 3- Correction) | Amount |
VAN10001 | 1 | 100 |
VAN10001 | 2 | 100 |
VAN10002 | 1 | 500 |
VAN10002 | 3 | 420 |
VAN10003 | 1 | 800 |
VAN10003 | 3 | 950 |
VAN10003 | 2 | 950 |
I want to create a column that has the latest invoice Amount where any correction happend, smiliar to below
Invoice No./ | Amount |
VAN10001 | 100 |
VAN10002 | 420 |
VAN10003 | 950 |
I'v solved your problem based on the assumption that each invoice no has at most 3 times for submission
please let me know if it works for you
@Mamoun_issa
You can add a new column with the code below:
Latest Amount =
VAR M =
CALCULATE(
MAX(Table1[Mode]),
ALLEXCEPT(Table1,Table1[Invoice No.])
)
VAR I =
CALCULATE(
MAX(Table1[Invoice No.]),
Table1[Mode] = M,
ALLEXCEPT(Table1,Table1[Invoice No.])
)
RETURN
IF( Table1[Invoice No.]=I && Table1[Mode] = M , Table1[Amount] , BLANK() )
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Mamoun_issa - You could do that as a measure in a table visualization with Invoice No. I mocked it up and provided a sample PBIX for you. It is Table (10), Measure (10) on Page 10.
Measure 10 =
VAR __ModeMax = MAX([Mode])
RETURN
MAXX(FILTER('Table (10)',[Mode] = __ModeMax),[Amount])
See attached PBIX below sig.
@Mamoun_issa , Try with invoice no in visual
lastnonblankvalue(table[mode], max(Table[amount]))
Thank you, but this will get me the max, assuming some invoices became less
@Mamoun_issa , find the file attached.
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
14 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |