cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
donbonbon
Frequent Visitor

Something wrong with calculated column (using filtering in it)

Hey,

 

I cannot figure out what is wrong with this formula Column = calculate(DISTINCTCOUNT('DB'[lead_id],FILTER('DB', 'DB'[status]="accepted")))

 

Thnx!

1 ACCEPTED SOLUTION

Accepted Solutions
muchinski Resolver II
Resolver II

Re: Something wrong with calculated column (using filtering in it)

Please, try the following:

Column = calculate(DISTINCTCOUNT('DB'[lead_id]),'DB'[status]="accepted")

 

Explanation: The second part for the CALCULATE is already the filter expression. You don't need to use FILTER in this case. In addition, DISTINCTCOUNT accepts only 1 parameter, so you need to close your parenthesis right after 'DB'[lead_id].

EXTRA TIP: If you want this expression to consider also the other filters applied on you report, you can use the following:

Column = calculate(DISTINCTCOUNT('DB'[lead_id]),KEEPFILTERS('DB'[status]="accepted"))



View solution in original post

5 REPLIES 5
muchinski Resolver II
Resolver II

Re: Something wrong with calculated column (using filtering in it)

Please, try the following:

Column = calculate(DISTINCTCOUNT('DB'[lead_id]),'DB'[status]="accepted")

 

Explanation: The second part for the CALCULATE is already the filter expression. You don't need to use FILTER in this case. In addition, DISTINCTCOUNT accepts only 1 parameter, so you need to close your parenthesis right after 'DB'[lead_id].

EXTRA TIP: If you want this expression to consider also the other filters applied on you report, you can use the following:

Column = calculate(DISTINCTCOUNT('DB'[lead_id]),KEEPFILTERS('DB'[status]="accepted"))



View solution in original post

Re: Something wrong with calculated column (using filtering in it)

You will need to provide more information if you want help. Eg What are you expecting and what are you getting?



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
donbonbon
Frequent Visitor

Re: Something wrong with calculated column (using filtering in it)

sorry, I didnt think it was relevant. It just highlights me it in red. I need to count distinct lead_id from table DB where status od this lead_id is accepted

 

 

donbonbon
Frequent Visitor

Re: Something wrong with calculated column (using filtering in it)

there is no result, just an error. so I cant understand what is wrong with the sintaxis

Highlighted
donbonbon
Frequent Visitor

Re: Something wrong with calculated column (using filtering in it)

it worked, thnx a lot!

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors