Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have the following data:
Problem:
How can I create this measure?
Table with data where the correct sum in this example would be 287.
Quantity | Total value | Invoiced value |
0 | 6 | 11 |
0 | 10 | 11 |
5 | 0 | 15 |
0 | 15 | 12 |
1 | 123 | 140 |
1 | 23 | 5 |
2 | 6 | 6 |
0 | 9 | 7 |
4 | 1 | 10 |
1 | 0 | 1 |
5 | 50 | 5 |
3 | 5 | 15 |
2 | 3 | Not invoiced |
4 | 5 | Not invoiced |
1 | 8 | Not invoiced |
0 | 9 | 15 |
2 | 6 | 14 |
4 | 1 | 12 |
5 | 0 | 11 |
0 | 15 | 11 |
Solved! Go to Solution.
I managed to solve this myself. Many thanks @some_bih for helping along the way and asking the right questions!
I managed to solve this myself. Many thanks @some_bih for helping along the way and asking the right questions!
Edited my latest post with a new table, since I need to consider also local currency.
Hi @carlenb there is possible scenario
If the value in column 'Quantity' =0 and column 'Total value'>0 l(first row example)
If the value in column 'Quantity' >0 and column 'Total value'=0 l(third row example)
what to do?
Proud to be a Super User!
Hi @some_bih
Thanks, well spotted! See below answers. You can also see the correct values for these scenarios in the screenshot in the thread start (Column E)
If the value in column 'Quantity' =0 and column 'Total value'>0 l(first row example) If Quantity = 0 then it would be Total value even if Total value = 0 or >0
If the value in column 'Quantity' >0 and column 'Total value'=0 l(third row example) If quantity > 0 then go for Total value even if Total value is = 0
Hi @carlenb could you please once again check your conditions =0 and >0 could be Invoiced value and total value
Proud to be a Super User!
Hi @some_bih I checked and here are the conditions:
There is also one more requirement that popped up:
Quantity | Total value | Invoiced value | Order number |
0 | 6 | 11 | 1 |
0 | 10 | 11 | 2 |
5 | 0 | 15 | 3 |
0 | 15 | 12 | 3 |
1 | 123 | 140 | 4 |
1 | 23 | 6 | 5 |
2 | 6 | 6 | 5 |
0 | 9 | 7 | 6 |
4 | 1 | 10 | 7 |
1 | 0 | 1 | 8 |
5 | 50 | 5 | 9 |
3 | 5 | 15 | 10 |
2 | 3 | Not invoiced | 11 |
4 | 5 | Not invoiced | 11 |
1 | 8 | Not invoiced | 11 |
0 | 9 | 15 | 12 |
2 | 6 | 15 | 12 |
4 | 1 | 12 | 13 |
5 | 0 | 11 | 14 |
0 | 15 | 11 | 14 |
Hi @carlenb so for condition
Proud to be a Super User!
Hi @some_bih see below answers
Edit:
One update since yesterday is that I have calculated Total Value in local currency with the below measure. This is something to consider too becuase instead of Total Value I need to use Invoiced value based on the conditions mentioned above. I have updated the table so that this is reflected. The reason for updating is because I realized the problem was more complex than first.
Order number | Quantity | Total value | Invoiced value | Currency | Purchase order date |
1 | 1 | 6 | 11 | SEK | 2019-04-02 |
1 | 0 | 10 | 11 | NOK | 2019-04-03 |
2 | 5 | 0 | 15 | EUR | 2019-04-04 |
2 | 2 | 15 | 12 | EUR | 2019-04-05 |
3 | 1 | 123 | 140 | EUR | 2019-04-06 |
3 | 0 | 23 | 5 | SEK | 2019-04-07 |
4 | 2 | 6 | 6 | USD | 2020-04-02 |
4 | 1 | 9 | 7 | NOK | 2020-04-03 |
5 | 4 | 1 | 10 | EUR | 2020-04-04 |
5 | 1 | 0 | 1 | EUR | 2020-04-05 |
6 | 5 | 50 | 5 | EUR | 2020-04-06 |
6 | 0 | 5 | 15 | SEK | 2021-04-07 |
7 | 2 | 3 | Not invoiced | USD | 2021-04-02 |
7 | 4 | 5 | Not invoiced | NOK | 2021-04-03 |
8 | 1 | 8 | Not invoiced | EUR | 2021-04-04 |
8 | 1 | 9 | 15 | EUR | 2021-04-05 |
9 | 2 | 6 | 14 | EUR | 2021-04-06 |
10 | 4 | 1 | 12 | SEK | 2022-04-07 |
11 | 5 | 0 | 11 | USD | 2022-04-08 |
11 | 1 | 15 | 11 | SEK | 2022-04-09 |
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |