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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
123abc
Community Champion
Community Champion

sumif based on different criteria in power bi desktop

Hi Experts:

i want to sumup Turnover data based on below different criteria (May measure or calculated column):

In my assignemtn there are 4 Tables (All tables are relational) :

1: Sales Turnvoer Table / Live Sales Journal invoice level entries.
2: Singed Turnvoer Table.  customer given with IDs and custoemr wise turnvoer amount given.
3: Item Master Table. like Refrigerator, Deep Freezer, Split AC, Microwave oven, Water Dispanser, Washing Machine.
4: Customer Master Table. 

Criterias:

1: 'Sales Table'[Invoice Date] >= DATE(202381)

2: 'Sales Table'[Invoice Date] <= DATE(20231231)

3:  RELATED('ITEM MASTER'[FG_PRODUCT]) IN {"Ref_D/Cool" , "Deep Freezer", "Split AC"}

4: '5 MTO Signed'[NewKey] = 'Sales Table'[NewKey]

Requirement:

I wants to sum sales turnvoer of Refrigerator, Deep Freezer, Split AC from 1st Aug 23 to 31st Dec 23 only those customers whose have singed turnvoer amount.
i wants to present both dealers parallel that how much he signed turnover and how much he generate turnvoer in sales journal.

Already tried Measures:

 

Measure 1:

TargetedTurnover =
CALCULATE(
    SUM('Sales Table'[NetSales]),
    FILTER(
        'Sales Table',
        '5 MTO Signed'[NewKey] = 'Sales Table'[NewKey]
        && 'Sales Table'[Invoice Date] >= DATE(202381)
        && 'Sales Table'[Invoice Date] <= DATE(20231231)
        && RELATED('ITEM MASTER'[FG_PRODUCT]IN {"Ref_D/Cool" , "Deep Freezer""Split AC"}
    )
)

Measure 2:

Turnover Aug-Dec 2023 =
VAR StartDate = DATE(202381)
VAR EndDate = DATE(20231231)
VAR CustomerCode = '5 MTO Signed'[NewKey]
RETURN
    SUMX(
        FILTER(
            'Sales Table',
            'Sales Table'[NewKey] = '5 MTO Signed'[NewKey] &&
            'Sales Table'[Invoice Date] >= StartDate &&
            'Sales Table'[Invoice Date] <= EndDate &&
            RELATED('ITEM MASTER'[FG_PRODUCT]IN {"Ref_D/Cool" , "Deep Freezer""Split AC"}
        ),
        'Sales Table'[NetSales]
    )

Above measures are not shwo required results.

 

Sample pbix file is given 

https://drive.google.com/file/d/11AeFr96LfLGEIRuAlRY-HxEiTqJSEcKl/view?usp=sharing

3 REPLIES 3
ERD
Community Champion
Community Champion

Hi @123abc , the access to your file is restricted. Do you receive errors in your measures? From what I can see, you need some aggregation or SELECTEDVALUE for CustomerCode variable in the second measure.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

123abc
Community Champion
Community Champion

Dear Sir,

 

Sorry for incovience now restricton on remove.

Sample Data.

Open Link for every one.

https://drive.google.com/file/d/11AeFr96LfLGEIRuAlRY-HxEiTqJSEcKl/view?usp=sharing

ERD
Community Champion
Community Champion

@123abc , from your file I don't see what's wrong and what is to be done. Besides,

  • there's no '5 MTO Signed' table
  • there's no 'Sales Table'[NewKey] column (as far as I understand [CustomerCode] is used instead)
  • you already seem to have a calculated column with the expected result

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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