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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Dicko
Helper II
Helper II

count per date

I want to show the number of products sold per date in a table visual.

 

I've got a measure NrOfProducts = COUNTROWS(Products)

Also I've got Products[sold on] of type date/time (not a Date Hierarchy btw).

Added both as values in the visual.

 

I want to see this:

Sold on  Amount
1/1/2021  2
2/1/2021  1

 

But what I see now is:

Sold on  Amount
1/1/2021  1
1/1/2021  1
2/1/2021  1

 

What am I missing?

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Dicko,

 

You can try measure as:

Measure = 
CALCULATE(
    COUNTROWS('Products'),
    FILTER(
        ALL('Products'),
        'Products'[Sold on]=MAX('Products'[Sold on])
    )
)

v-xulin-mstf_0-1622792528962.png

v-xulin-mstf_1-1622792541405.png

v-xulin-mstf_2-1622792595602.png

 

You can also removing other columns with different values from the table visual, and then your original measure will work well.

 

Best Regards,
Link

 

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
v-xulin-mstf
Community Support
Community Support

Hi @Dicko,

 

You can try measure as:

Measure = 
CALCULATE(
    COUNTROWS('Products'),
    FILTER(
        ALL('Products'),
        'Products'[Sold on]=MAX('Products'[Sold on])
    )
)

v-xulin-mstf_0-1622792528962.png

v-xulin-mstf_1-1622792541405.png

v-xulin-mstf_2-1622792595602.png

 

You can also removing other columns with different values from the table visual, and then your original measure will work well.

 

Best Regards,
Link

 

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

ryan_mayu
Super User
Super User

@Dicko 

maybe it only shows date without time for sold on column, you can try to convert sold on column from date type to datetime type to see if the time on 2020/1/1 is different.  Changing data type will not change the data.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




PoojaDarbhe
Resolver I
Resolver I

Hi @Dicko 

 

Could you please post your table structure?

 

Otherwise you can try like fllowing

1) take date and product in the grid

2) then click on the product column in fields pane

3) now click on count

 

It will give you the correct result.

 

Best regards,

Pooja Darbhe

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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