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

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.

Reply
Anonymous
Not applicable

Measure question

Hi friends, 

 

I have the following question. 

I have a dataset with a column were two order types ('Mandaatopdr. met contract' and 'Mandaatopdr. zonder contract') are stated. 

Each order (row) has a mandate amount and after the job is done and we receive an invoice, the row will have an invoiced amount as well.

 

For each order type I need to provide the following information:

 

Give per order type the sum of the values in the column mandate amount, but only when invoiced amount cell is 'blank'. (in other words; what is per order type the total value of the mandate amount of those orders were we haven't received an invoiced amount). 

 

Hope you can help me. Below you find an example of the data.

 

Many thanks in advance!

 

Cheers, Sander

 

Mld Melding KeyMld Opdr Bedrijfopdr VolgnrOrder typeOrder dateDistrictInvoiced amountMandate amount
774511Mandaatopdr. zonder contract1-11-2019Noord281,89200
774521Mandaatopdr. zonder contract1-11-2019Midden NL 500
774532Mandaatopdr. zonder contract1-11-2019Den Haag 500
774672Mandaatopdr. zonder contract1-11-2019Den Haag135500
774711Mandaatopdr. zonder contract1-11-2019Rotterdam 500
775121Mandaatopdr. met contract1-11-2019Noord 50
775151Mandaatopdr. zonder contract1-11-2019Noord337,35400
775562Mandaatopdr. met contract1-11-2019Oost 541
775581Mandaatopdr. zonder contract1-11-2019Den Haag 472,5
775781Mandaatopdr. met contract1-11-2019Amsterdam 900
775861Mandaatopdr. zonder contract1-11-2019Oost 500
775871Mandaatopdr. zonder contract1-11-2019Noord491,2500
775911Mandaatopdr. zonder contract1-11-2019Den Haag2061500
776001Mandaatopdr. zonder contract1-11-2019Oost 756
776002Mandaatopdr. zonder contract1-11-2019Oost 805
776003Mandaatopdr. zonder contract1-11-2019Oost 805
776004Mandaatopdr. zonder contract1-11-2019Oost 100
776152Mandaatopdr. met contract1-11-2019Noord 700
776832Mandaatopdr. zonder contract4-11-2019Den Haag225500
776911Mandaatopdr. zonder contract4-11-2019Rotterdam410,21500
776981Mandaatopdr. met contract4-11-2019Midden NL 500
777091Mandaatopdr. met contract4-11-2019Rotterdam 1055,8
777161Mandaatopdr. zonder contract4-11-2019Midden NL 153,42
777162Mandaatopdr. zonder contract4-11-2019Midden NL 153,42
777312Mandaatopdr. zonder contract4-11-2019Amsterdam 150
777392Mandaatopdr. zonder contract4-11-2019Midden NL 500
777541Mandaatopdr. met contract4-11-2019Rotterdam 250
777581Mandaatopdr. zonder contract4-11-2019Oost111,22145
777581Mandaatopdr. zonder contract4-11-2019Oost33,44145
777591Mandaatopdr. met contract4-11-2019Amsterdam 200
777672Mandaatopdr. zonder contract4-11-2019Amsterdam 200
777741Mandaatopdr. zonder contract4-11-2019Den Haag74,48500
777741Mandaatopdr. zonder contract4-11-2019Den Haag74,48500
777741Mandaatopdr. zonder contract4-11-2019Den Haag37,24500
777811Mandaatopdr. met contract4-11-2019Amsterdam51,6850
778501Mandaatopdr. met contract5-11-2019Den Haag923,581000
1 ACCEPTED SOLUTION
JarroVGIT
Resident Rockstar
Resident Rockstar

Always fun to create a measure here and there 🙂 Had some trouble in the beginning because I didn't do the formatting correcly (decimal numbers) but that was because of the locale settings of my Excel and PBI 😉

 

Anyway, here is the Measure you can use for it:

 

Measure = 
IF(HASONEVALUE('Table'[Order type]), 
    VAR orderType = SELECTEDVALUE('Table'[Order type])
    RETURN
    CALCULATE(SUM('Table'[Mandate amount]), FILTER(ALL('Table'), 'Table'[Order type] = orderType && ISBLANK('Table'[Invoiced amount]) = TRUE)))

 

Creating a Table visual with the column 'Order type' and the measure results in this:

image.png

Note that this measure only returns a result in a context of a single Order Type, and hence the total line is empty (as that evaluates the measure for the whole data set, so with two order types present). If you don't want that, you can simplify the measure like to this:

Measure = CALCULATE(SUM('Table'[Mandate amount]), FILTER('Table', ISBLANK('Table'[Invoiced amount]) = TRUE))

Resulting in the following table visual:

image.png

 

Let me know if this works! 🙂

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
 
Best Regards
Maggie
Anonymous
Not applicable

Hi Maggy,

 

Sorry for the delay. This friday, I have time to check the proposed solution (and accept it if it works).

 

Cheers, Sander 

JarroVGIT
Resident Rockstar
Resident Rockstar

Always fun to create a measure here and there 🙂 Had some trouble in the beginning because I didn't do the formatting correcly (decimal numbers) but that was because of the locale settings of my Excel and PBI 😉

 

Anyway, here is the Measure you can use for it:

 

Measure = 
IF(HASONEVALUE('Table'[Order type]), 
    VAR orderType = SELECTEDVALUE('Table'[Order type])
    RETURN
    CALCULATE(SUM('Table'[Mandate amount]), FILTER(ALL('Table'), 'Table'[Order type] = orderType && ISBLANK('Table'[Invoiced amount]) = TRUE)))

 

Creating a Table visual with the column 'Order type' and the measure results in this:

image.png

Note that this measure only returns a result in a context of a single Order Type, and hence the total line is empty (as that evaluates the measure for the whole data set, so with two order types present). If you don't want that, you can simplify the measure like to this:

Measure = CALCULATE(SUM('Table'[Mandate amount]), FILTER('Table', ISBLANK('Table'[Invoiced amount]) = TRUE))

Resulting in the following table visual:

image.png

 

Let me know if this works! 🙂

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.