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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
DboltonRta
Regular Visitor

Display average count of item numbers based on date range slicer

Hi All thank you for your help.

I am a novice with Power BI, i am trying to write a few simple reports and so far without the use of DAX i am doing just fine but these are basic visuals only.
I am trying to write a report that shows all warehouse movements from Business 365 for one location. I can pull in the macro data and can create a reasonably decent visual but i need to create an average count on a card.
I have lets say 70 item movements over 7 days, i want the card to display "10", and if possible for the title of the card to change to the number of days selected.

 

Also any idea how to make the "Blank" card display "0" instead?

Any ideas?

DboltonRta_0-1677074785663.png

 

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@DboltonRta , You have to try a measure like

 

Averagex(Values(Date[Date]), calculate(Sum(Table[Value])) )

 

you can change Date[Date] with column on which you want Avg

View solution in original post

Thanks Sebastian, i have tried it again and removed the extra )'s...
Its the number circled and it doesnt seem to divide at all.
I just want it to divide by the count of days shown. Sorry if i seem totally clueless, its only because i am, Power Bi is totally new to me.

DboltonRta_0-1677166071027.png

 

View solution in original post

Thank you for your help. Both solutions actually worked.
As a novice (i know this sounds thick) i didnt realise the measure created a new item on my table that i could select and display as a card. I was trying to make the measure apply to an already present card on my display.

View solution in original post

6 REPLIES 6
sebastiandyrby
Resolver I
Resolver I

Hi

I suppose you have the table shown in the screenshot. Here, I imagine each row is a single item movement. Then you can combine a count with a count of the number of days to get the average. So something like this:

AverageMovements = 

DIVIDE(
    COUNT(Table[Entry_Type]),
    DISTINCTCOUNT(Table[Day])
)

Which counts the number of rows in your 'Table' and divides this with the number of distinct days. 

 

Hope this helps!

Best regards,

Sebastian

 

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

Thanks Sebastian, im getting the below message/error:

DboltonRta_0-1677080376531.png

 

I think that's simply because of the number of closing brackets at the end. You should have a single ')' on your last line of code that closes the DIVIDE-function because the COUNT and DISTINCTCOUNT functions are closed in their respective lines. 

Thanks Sebastian, i have tried it again and removed the extra )'s...
Its the number circled and it doesnt seem to divide at all.
I just want it to divide by the count of days shown. Sorry if i seem totally clueless, its only because i am, Power Bi is totally new to me.

DboltonRta_0-1677166071027.png

 

amitchandak
Super User
Super User

@DboltonRta , You have to try a measure like

 

Averagex(Values(Date[Date]), calculate(Sum(Table[Value])) )

 

you can change Date[Date] with column on which you want Avg

Thank you for your help. Both solutions actually worked.
As a novice (i know this sounds thick) i didnt realise the measure created a new item on my table that i could select and display as a card. I was trying to make the measure apply to an already present card on my display.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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