Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi Experts,
I have the following sample data:
Order Id | Line Id | Quantity | Unit Price |
12345 | 1 | 4 | 10 |
12345 | 2 | 3 | 11 |
54321 | 1 | 8 | 4 |
54321 | 2 | 5 | 9 |
54321 | 2 | 7 | 0 |
I need to create Revenue where Revenue = Quantity * Unit Price
In case of Unit Price = 0, Revenue will be equal to product of sum of quantity and non zero "Unit Price" for the corresponding "Order Id" and "Line Id".
In my report I need to show only "Order Id" ,"Quantity" and "Revenue", the data should be as below in "Table" visual:
Order Id | Quantity | Revenue |
12345 | 7 | 73 |
54321 | 20 | 140 |
Calculation needed for "Order Id": 12345 = (4*10) +(3*11)= 73
Calculation needed for "Order Id": 54321 = (8*4) +((5+7)*9)= 140
Here for "Order Id": 54321, as shown above,Revenue will be equal to product of sum of quantity and non zero "Unit Price" for the corresponding "Line Id".
Can you please suggest how we can achieve this requirement.
Solved! Go to Solution.
Hi @TusharGaurav - create a DAX measure that handles the logic to sum quantities and apply the non-zero unit price when necessary.
you can replace with your table name:
Ouput:
Hope this works
Proud to be a Super User! | |
Hi @TusharGaurav - create a DAX measure that handles the logic to sum quantities and apply the non-zero unit price when necessary.
you can replace with your table name:
Ouput:
Hope this works
Proud to be a Super User! | |
Hi Rajendra,
Thanks a lot for your help.
It worked 🙂
Thanks and Regards,
Tushar Gaurav
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.