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.
Can someone kindly help me with this calculated measure?
I am trying to get this measure not to exclude Line 2 Charge Amount Totals. The sum for Charge Line ID 8264 should be $576. My measure doesn't take into account some Charges may be on Line 2, 3, etc.
Here is my current measure. Thank you in advance!!!!!
Total Charge | MRN | Charge ID | Charge Line ID | Acct Date | CPT | Last Modified Date | Line Number | Is Latest |
576 | 3930 | 8063 | 8264 | 4/1/22 | Q9967 | 4/1/22 | 2 | False |
576 | 3930 | 8063 | 8264 | 4/1/22 | Q9967 | 4/5/22 | 2 | False |
576 | 3930 | 8063 | 8264 | 4/1/22 | Q9967 | 4/20/22 | 2 | False |
956.72 | 3930 | 8064 | 8265 | 4/1/22 | 76700 | 4/1/22 | 1 | False |
956.72 | 3930 | 8064 | 8265 | 4/1/22 | 76700 | 4/5/22 | 1 | False |
956.72 | 3930 | 8064 | 8265 | 4/1/22 | 76700 | 4/20/22 | 1 | True |
Solved! Go to Solution.
@TheSweeper , Try a measure like
Measure =
VAR __id = MAX ('Table'[Charge Line ID] )
VAR __date = CALCULATE ( MAX('Table'[Charge Last Modified Date] ), ALLSELECTED ('Table' ), 'Table'[Charge Line ID] = __id )
return
CALCULATE ( Sum ('Table'[Total Charge] ), VALUES ('Table'[Charge Line ID] ),'Table'[Charge Line ID] = __id,'Table'[Charge Last Modified Date] = __date )
Woohooo I figured it out
@amitchandak Thank you so much for your help!
I used this formula to return the correct total.
If you have time do you mind taking a stab at this? Unfortunately I can't continue building my report without this formula being completely correct in its output. 😞
Also an amateur, but does using filter within the CALC help you here?
https://community.powerbi.com/t5/Desktop/DAX-Calculate-the-Max-for-a-Group/td-p/64645
I tried but it didn't work. Thank you though!
@TheSweeper , Try a measure like
Measure =
VAR __id = MAX ('Table'[Charge Line ID] )
VAR __date = CALCULATE ( MAX('Table'[Charge Last Modified Date] ), ALLSELECTED ('Table' ), 'Table'[Charge Line ID] = __id )
return
CALCULATE ( Sum ('Table'[Total Charge] ), VALUES ('Table'[Charge Line ID] ),'Table'[Charge Line ID] = __id,'Table'[Charge Last Modified Date] = __date )
Your measure now gives me the correct data just the incorrect total. Truly appreciate your help!!!
Any suggestions on how I can show the correct total? 576+956.72+1,6803.96 = $3,213.68
I added the new measure below the screenshot.
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 |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |