- Forums
- Get Help with Power BI
- Desktop
- Service
- Report Server
- Power Query
- Mobile Apps
- Developer
- DAX Commands and Tips
- Let's Talk Data
- Custom Visuals Development Discussion
- Community Support
- Community Information
- Community Accounts & Registration
- Using the Community
- Community Feedback
- Training and Consulting
- Dashboard in a Day
- EdX Specific Training Discussion Forum

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Forums
- Get Help with Power BI
- Desktop
- Re: Calculating SUM of TOPN rows ?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

hamzahad91

Regular Visitor

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2017
01:22 AM

I have two columns

Done | Objectif

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

2 | 8

4 | 6

6 | 14

null | 12

null | 11

null | 9

.. | ..

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

I would that I print the Sum of 3 first rows beause I done column we have juste 3 rows ( every mounth a value get added )

I think that I should use something lik SUM (table1[Objectif(TopN(COUNTROWS[Done])]) But It's not the right expression

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

v-jiascu-msft

Community Support Team

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-02-2017
10:42 PM

Hi @hamzahad91,

If your table is the one you posted here, maybe you could try this formula as a measure.

Measure = CALCULATE ( SUM ( Table1[Objectif] ), ISBLANK ( Table1[Done] ) = FALSE () )

Or maybe you could add an index first, then it's easy to get the top three rows.

Measure 2 = CALCULATE ( SUM ( Table1[Objectif] ), 'Table1'[Index] <= 2 )

Best Regards!

Dale

Community Support Team _ Dale

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

If this post

4 REPLIES 4

hamzahad91

Regular Visitor

Re: Calculating SUM of TOPN rows ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2017
01:58 AM

Sorry I have made some mistakes I don't know how to mofify my post :

I would print the sum of 3 first rows beause in done column I have juste 3 rows ( every mounth a row will be added )

I think that I woulduse something like SUM (table1[Objectif(TopN(COUNTROWS[Done])]) But It's not the right expression

Here the result of my measure will be 28 ( 6+8+14 ).

v-jiascu-msft

Community Support Team

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-02-2017
10:42 PM

Hi @hamzahad91,

If your table is the one you posted here, maybe you could try this formula as a measure.

Measure = CALCULATE ( SUM ( Table1[Objectif] ), ISBLANK ( Table1[Done] ) = FALSE () )

Or maybe you could add an index first, then it's easy to get the top three rows.

Measure 2 = CALCULATE ( SUM ( Table1[Objectif] ), 'Table1'[Index] <= 2 )

Best Regards!

Dale

Community Support Team _ Dale

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

If this post

hamzahad91

Regular Visitor

Re: Calculating SUM of TOPN rows ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-03-2017
05:17 AM

CALCULATE ( SUM ( Table1[Objectif] ), ISBLANK ( Table1[Done] ) = FALSE () )

Can you explain me what does do the ISBLANK (Table1[Done] ) = FALSE() instruction ?

Highlighted
##

v-jiascu-msft

Community Support Team

Re: Calculating SUM of TOPN rows ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-03-2017
06:05 AM

Hi @hamzahad91,

I have seen there were NULL values. Null is blank in Power BI unless you use it as a text. ISBLANK (Table1[Done] ) is going to check if "Table1[Done]" is blank. The return value of ISBLANK() is a Boolean, which is True or False. So "ISBLANK (Table1[Done] ) = FALSE()" return the first three rows, which isn't blank.

Best Regards!

Dale

Community Support Team _ Dale

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

If this post