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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dinesharivalaga
Post Patron
Post Patron

Calculated column for the duplicated account to sum the forecast values

Hi Experts,

 

I am working on the below case:

Requirements : We have to sum all rows with the same account names but different Offer Types , if the sum of the forecast value is >500K then it is Key Account "Yes" else Key Account "No"

for example :

AccountOffertypeforecastkey accounts
AAAQ2334 
BBBQ34556 
CCCA675454 
AAAA499523 
DDDQ65454 
BBBA9453 


Row 1 : Account name is AAA, Offer type is Q and Forecast value is 2334
Row 4 : Account name is AAA , Offer type is A and Forecast value is 499523 then the sum of the AAA is >500K then it is "Yes". if row 1 & row 2 has less than 500K forecast value then it is "No" 

Same logic for row 2 & 6 , I need to add this calculated column "Key Accounts" into page filter pane and select Yes or No in different bookmarks. So the account name should be unique with summing forecast values when it publishing in the table visual (no duplicate account names displaying)

 

Please help to achieve this asap 

 

Thanks

DK

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dinesharivalaga ,

I create a table as you mentioned.

vyilongmsft_0-1726541841755.png

Then I create a measure and here is the DAX code.

Column = 
VAR _AccountSum = 
    CALCULATE(
        SUM('Table'[Forecast]),
        ALLEXCEPT('Table', 'Table'[Account])
    )
RETURN
     IF(_AccountSum > 50000, "Yes", "No")

vyilongmsft_1-1726541976662.png

So I think you can use a slicer and create a new table.

vyilongmsft_2-1726542028414.png

vyilongmsft_3-1726542100559.png

vyilongmsft_4-1726542585301.png

 

 

 

Best Regards

Yilong Zhou

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @dinesharivalaga ,

I create a table as you mentioned.

vyilongmsft_0-1726541841755.png

Then I create a measure and here is the DAX code.

Column = 
VAR _AccountSum = 
    CALCULATE(
        SUM('Table'[Forecast]),
        ALLEXCEPT('Table', 'Table'[Account])
    )
RETURN
     IF(_AccountSum > 50000, "Yes", "No")

vyilongmsft_1-1726541976662.png

So I think you can use a slicer and create a new table.

vyilongmsft_2-1726542028414.png

vyilongmsft_3-1726542100559.png

vyilongmsft_4-1726542585301.png

 

 

 

Best Regards

Yilong Zhou

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

bhanu_gautam
Super User
Super User

@dinesharivalaga First create a new calculated column

 

Total Forecast =
CALCULATE(
SUM('Table'[forecast]),
ALLEXCEPT('Table', 'Table'[Account])
)

 

Then create one more calculated column to determine if the account is a Key Account based on the total forecast value:

Key Account =
IF('Table'[Total Forecast] > 500000, "Yes", "No")

 

Remove duplicate account names by creating a summarized table.

SummaryTable =
SUMMARIZE(
'Table',
'Table'[Account],
"Total Forecast", SUM('Table'[forecast]),
"Key Account", IF(SUM('Table'[forecast]) > 500000, "Yes", "No")
)

 

Create a relationship between the original table and the summarized table if necessary.

Add the Key Account column to the filter pane. You can now use this column to filter your data based on whether the account is a Key Account or not.

Create bookmarks to save different views (Yes or No) and use them as needed.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam  Thanks for your solution 🙂

 

I have tried to use the above solution , but I am already having a Total FY Forecast measure to use "

Total FY Forecast = SUMX(VALUES('Test Delivery Updates'[FY Forecast]),CALCULATE(DISTINCT('Test Delivery Updates'[FY Forecast]))) 
Because I have many duplicate rows after made a unpivot column concept , so that i have used DISTINCT in the above measure , I am using this measures in the Table visual .
 
So I can't use this measure in the summarize DAX .
 
VAR _summarize =
    SUMMARIZE (
        'Test Delivery Updates',
        'Test Delivery Updates'[Account Name],
        'Test Delivery Updates'[Key Account 1]
    )
VAR _AcName = 'Test Delivery Updates'[Account Name]
VAR _FYForecast =
    SUMX ( FILTER ( _summarize, [Account Name] = _AcName), [Total FY Forecast] )  -- used my existing measure here
RETURN
    IF ( _FYForecast > 500000, "Yes", "No")
 
Above is the query i am trying to use but no luck 😞

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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