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

Help

Hello all,

 

Can anyone please help me to understand whats the mistake I'm making in the following DAX formula:

 

Site Visits = COUNTROWS(
SUMMARIZE('4. CoW Productivity', '4. CoW Productivity'[Project Number], '4. CoW Productivity'[Date Created]))
 
As you can see below, I'm getting the values I need (I already checked they're correct), but I don't understand why the total shows me a wrong value (it should be 261 instead of 253).
 
AndresTorresM_0-1630911821770.png

Many thanks,

 

Andres Torres

 
1 ACCEPTED SOLUTION

Hi @SantiagoTorres ,

 

Sorry for my late reply.

 

Try this

Site Visits = COUNTROWS(DISTINCT('4  CoW Productivity'))

9.png

 

 

Best Regards,

Stephen Tao

 

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

9 REPLIES 9
v-stephen-msft
Community Support
Community Support

Hi @SantiagoTorres ,

 

Try this measure

 

Site Visits = CALCULATE(COUNTROWS('4  CoW Productivity'),ALLEXCEPT('4  CoW Productivity','4  CoW Productivity'[Assigness],'4  CoW Productivity'[Date Created],'4  CoW Productivity'[Project Number]))

 

3.png

 

Best Regards,

Stephen Tao

 

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

Hi Stephen, thank you for your response,

 

Still not getting the values I need, 

 

Project NumberProject AddressDate CreatedAssignee(S)
B037 B03820 Miller Street25/8/21Steve Gray
B0213 Market Street25/8/21Jake Van der Zant
B080331 Orrong Road25/8/21Paul O'Callaghan
B080331 Orrong Road25/8/21Paul O'Callaghan
B035 B03612-18 Miller Street25/8/21Steve Gray
B0213 Market Street25/8/21Jake Van der Zant
B01010 Tennyson Street25/8/21Paul O'Callaghan
B01010 Tennyson Street25/8/21Paul O'Callaghan
B035 B03612-18 Miller Street25/8/21Steve Gray
B080331 Orrong Road23/8/21Paul O'Callaghan

 

I need to get project numbers by date (#visits), but when the project number is repeated on the same date, I should count it just once. For instance, in this table B080=2 and B010=1, etc.,

 

Many thanks,

 

Andres Torres

Hi,

In the Table that you have shared in your post, could you kinldy show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, thanks for your response,

 
As you can see below, I'm getting the values I need per Assignee (I already checked they're correct), but I don't understand why the total shows me a wrong value (it should be 261 instead of 253).
 
AndresTorresM_0-1631523146875.png

I cannot load all the data here (I couldn't find a way to load attachments), but please see below the logic of my calculation with a portion of the data I have.

 

Project NumberProject AddressDate CreatedAssignee(S)
B037 B03820 Miller Street25/8/21Steve Gray
B0213 Market Street25/8/21Jake Van der Zant
B080331 Orrong Road25/8/21Paul O'Callaghan
B080331 Orrong Road25/8/21Paul O'Callaghan
B035 B03612-18 Miller Street25/8/21Steve Gray
B0213 Market Street25/8/21Jake Van der Zant
B01010 Tennyson Street25/8/21Paul O'Callaghan
B01010 Tennyson Street25/8/21Paul O'Callaghan
B035 B03612-18 Miller Street25/8/21Steve Gray
B080331 Orrong Road23/8/21Paul O'Callaghan

 

I need to get project numbers by the date the site has been visited (#visits), but when the project number is repeated on the same date, I should count it just once. For instance, in this  little table, we should get as a result that B080=2 and B010=1, etc.,

Am I clear with that information?, kind of hard to show more details, sorry.

 

Thanks,

 

Andres Torres

 

 

 

 

 

Hi,

Has Stephen Tao alsready answered your question?  Do you still need help?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello. thanks for your response,

 

It's working for me with the following modification:

 

Site Visits =
COUNTROWS(
SUMMARIZE('4. CoW Productivity', '4. CoW Productivity'[Project Number], '4. CoW Productivity'[Date Created],'4. CoW Productivity'[Assignee(S)])
)
 
AndresTorresM_0-1631576109296.png

Can you see I got the same values now, but in the total, I got 261 instead of 253, which is correct.

 

Many thanks,

 

ASTM

Hi @SantiagoTorres ,

 

Sorry for my late reply.

 

Try this

Site Visits = COUNTROWS(DISTINCT('4  CoW Productivity'))

9.png

 

 

Best Regards,

Stephen Tao

 

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

Fowmy
Super User
Super User

@SantiagoTorres 

Can you apply the following modified meaure?

Site Visits =
SUMX (
    VALUES ( '4. CoW Productivity'[Assignee(S)] ),
    COUNTROWS (
        SUMMARIZE (
            '4. CoW Productivity',
            '4. CoW Productivity'[Project Number],
            '4. CoW Productivity'[Date Created]
        )
    )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi, thank you so much for your response,

 

I already applied this formula:

 
Site Visits =
SUMX(
VALUES('4. CoW Productivity'[Assignee(S)]),
COUNTROWS(
SUMMARIZE(
'4. CoW Productivity',
'4. CoW Productivity'[Project Number],
'4. CoW Productivity'[Date Created]
)
)
)
 
And I get these results,
AndresTorresM_0-1630913728530.png

What you think??

 

Many thanks,

 

Andres Torres

 

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.

Top Solution Authors