Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kella
Frequent Visitor

DAX Measure - To get only one value for multiple rows

I am new to Power BI, I am facing issue where I want to create a new column based on the Invoice Date and the Invoice No.
In below table, I want to calculate "What I want" column using DAX​ measure to get $35 for each Invoice No and displaying values ($35) for any rows.


Invoice No   Invoice Date SKU   Invoice    What I want
1001    7/12/2022 a123  $250    $35
1001    7/12/2022 b123  $100 
1001    7/12/2022 c123  $10 
1002    6/6/2023 z123  $2    $35
1002    6/6/2023 y123  $4 
1023    1/4/2023 k123  $1    $35
1023    1/4/2023 v123  $1,00 
1023    1/4/2023 s123  $5 
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this

sum Invoice = SUM('Table'[Invoice])


-----
35 in Invoice = 
 
VAR _t1 = SELECTEDVALUE('Table'[Invoice No])
VAR _t2 = SELECTEDVALUE('Table'[Invoice Date])
VAR _tbl = FILTER(ALL('Table'),'Table'[Invoice No]=_t1&&'Table'[Invoice Date]=_t2)
VAR Results= RANKX(_tbl,[sum Invoice],,DESC)
RETURN
IF(Results =1,35)

 

Screenshot_3.pngScreenshot_2.png 

View solution in original post

5 REPLIES 5
Ahmedx
Super User
Super User

pls try this

sum Invoice = SUM('Table'[Invoice])


-----
35 in Invoice = 
 
VAR _t1 = SELECTEDVALUE('Table'[Invoice No])
VAR _t2 = SELECTEDVALUE('Table'[Invoice Date])
VAR _tbl = FILTER(ALL('Table'),'Table'[Invoice No]=_t1&&'Table'[Invoice Date]=_t2)
VAR Results= RANKX(_tbl,[sum Invoice],,DESC)
RETURN
IF(Results =1,35)

 

Screenshot_3.pngScreenshot_2.png 

Ahmedx
Super User
Super User

pls try this

Column = 
VAR _t1 = [Invoice No]
VAR _t2 = [Invoice Date]
VAR _tbl = FILTER(ALL('Table'),[Invoice No]=_t1&&[Invoice Date]=_t2)
VAR Results= RANKX(_tbl,[Invoice],,DESC)
RETURN
IF(Results =1,35)

Screenshot_1.png

Kella
Frequent Visitor

Thanks, @Ahmedx for your time. I think DAX you share is for the calculated column. I'm looking for a DAX measure to manage this.

Ritaf1983
Super User
Super User

Hi @Kella 

If i understood you correctly just add column with value you need an format it as currency:

Ritaf1983_0-1689906799264.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for your time but I need $35 to display for each Invoice No not for each row.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.