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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
leobelyaev
Frequent Visitor

Calculating average daily count from counting rows?

Hello,

 

New user.

I am not sure how to approach the project, since I am usnsure how to 'nest' functions in Power BI DAX or if that's even necessary.

 

Here's what My Dataset looks like:

screenshot.png

Each row represents an encounter.

My final result should be a dashboard that displays the average number of visits by DayOfWeek  (Monday, Tuesday etc.)

Ideally it needs to be able to show data at different levels. Either using drill through, toggle, slicer or have different tables showing:

 

Avg. number of visits by

Provider(VISIT_PROV_NAME),

Encounter Type(ENC_TYPE_TITLE),

Facility (FAC_ID)

modality (prc_modality).

 

I am not sure how to tackle this assignment in Power BI, but here are some steps I took to query for the same data in SQL, wonder if any of that logic carries over or helps at all.

 

1.Counted and summed up number of encounters by APPT_Date (by date), to get Daily Encounters

2. Got the average for Daily Encounters

3.Filtered by DayOfWeek, Provider, Enounter type, Facility, Modality.

 

I am now wondering if it is possible, and how hard it would be to perform the same process in Power BI, though I am very new.

 

Any help on how to approach this would be greatly appreciated!

 

Any suggestions on good tutorials etc. would be appreciated too!

 

Thanks!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@leobelyaev , Avg Daily would be like

 

Averagex(Values(Date[Date]), calculate(Count(Table[Column])) )

 

If you want to switch with the level you can use isinscope

 

Avg of Sum : https://youtu.be/cN8AO3_vmlY?t=22980

 

Isinscope

https://youtu.be/cN8AO3_vmlY?t=31995

IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@leobelyaev , Avg Daily would be like

 

Averagex(Values(Date[Date]), calculate(Count(Table[Column])) )

 

If you want to switch with the level you can use isinscope

 

Avg of Sum : https://youtu.be/cN8AO3_vmlY?t=22980

 

Isinscope

https://youtu.be/cN8AO3_vmlY?t=31995

IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, thank you so much Amit Chandak,

 

That helped a lot, I checked out your tutorial and used the code you sent.

 

However, I get very different results when using the formula you suggested, and when i tried to copy the forumla from your tutorial. I can't quite figure out why and how the results are so different from using seemingly similar logic behind the two formulas.

 

 

Do you think you could explain how this could be happening? If you could, you'd be better than ChatGPT, because it failed to explain to me hahah.

screenshot2.png

The first matrix uses this measure: 

Average visit = AVERAGEX(SUMMARIZE(PRC,PRC[APPT_DATE].[Date]),COUNT(PRC[ENC_TYPE_TITLE]))
 
The second uses this measure:
avg = AVERAGEX(Values(PRC[APPT_DATE]),CALCULATE(COUNT(PRC[ENC_TYPE_TITLE])))



 

 

By the way, planning to watch the rest of your 11.5 hour beginner course, you are great at explaining concepts, hands on, with examples, step by step! I really liked what I saw so far!

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.