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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Snapshot data in Power BI

Hi All,

 

I have a question about modelling data using Power BI.

 

In my industry we frequently report on the number of clients open to a staff member, team or service on any given day - e.g. there were 500 clients open to the team on 31st May 2016.

 

What is the best approach for managing these types of data (which typically can't be aggregated as it just represents a snapshot position on any given day) in a cube? I've found that Power BI tries to incorrectly aggregate these data in visualisations (e.g. aggregate 12 month end snapshots into a summed single year figure, which isn't correct).

 

Thanks

 

Pbix

7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous,

Could you please share sample data of your scenario and post the expected result? Also we need to know that what visualizations you are using.

Thanks,
Lydia Zhang

Anonymous
Not applicable

Hi Both,

 

Thanks for your replies. Sure, here's some simple data replicating my scenario. The eventual model would have multiple tables but the two most relevant tables are:

 

DIM_DATE and

FACT_PLANS

 

DIM_DATE is a date dimension, like:

 

DateYearMonthDay
01/03/2016201631
02/03/2016201632
03/03/2016201633
04/03/2016201634
05/03/2016201635
06/03/2016201636
07/03/2016201637
08/03/2016201638
09/03/2016201639
10/03/20162016310
11/03/20162016311
12/03/20162016312
13/03/20162016313
14/03/20162016314

 

and FACT_PLANS is a table like the below (with 1 million rows)

 

Client IDPlan TypePlan Start DatePlan End Date
1A01/01/201431/03/2016
2B01/03/201605/03/2016
3C02/03/201612/03/2016
4D01/04/201405/01/2015
5B31/05/201008/03/2016
6D01/08/201101/11/2015
7E01/05/201509/05/2016
8A14/07/201511/03/2016
9A14/05/201531/03/2016
10C15/05/201314/04/2016

 

What I would like to do is work out the number of plans open on any given day, for an expected result like:

 

DateNumber of plans open
01/03/20167
02/03/20168
03/03/20168
04/03/20168
05/03/20168
06/03/20167
07/03/20167
08/03/20167
09/03/20166
10/03/20166
11/03/20166
12/03/20165
13/03/20164
14/03/20164

 

What is the most performant way to dynamically claculate this using Power BI desktop, for any given date? From a visualisation perspective I'm thinking a plain bar or line chart.

 

Thanks!

 

Pbix

Anonymous
Not applicable

Hi @Anonymous,

You can create a measure named plan number in your FACT_PLANS table using the following formula. I test it in my environment which is shown in the screenshot below .

plan number = CALCULATE(COUNTROWS(FACT_PLANS),

   FILTER(FACT_PLANS, (FACT_PLANS [Plan Start Date] <= LASTDATE(DIM_DATE[Date])

       && FACT_PLANS [Plan End Date]>= FIRSTDATE(DIM_DATE[Date]))))

Capture2.JPG

Then create line chart by using the Date field and plan number measure as follows.
Capture.JPG

Thanks,
Lydia Zhang

Anonymous
Not applicable

Hi @Anonymous,

 

Thanks for the reply - really helpful. However, I'm having trouble replictating it in my environmnent - for me the measure returns a count of the total number of rows in the table in every row (though your example clearly works)!

 

What relationship are you using between FACT_PLANS and DIM_DATE?

 

Thanks alot,

 

Pbix

Anonymous
Not applicable

Hi @Anonymous,

 

Sorry, I was being an idiot - I was creating a calculated column, not measure! Oops...

 

When you have a moment, I'm still interested though - what relationship(s) did you define between DIM_DATE and FACT_PLANS? I ask because I current use DIM_DATE(date) and FACT_PLANS(Plan Start Date) and it doesn't quite return the correct values.

 

Thanks again 🙂

 

Pbix

Anonymous
Not applicable

Hi @Anonymous,

I just copy your sample data and enter it to Power BI Desktop, no relationship is created between the tables. What is the relationship between your tables? And what does your measure look like?

Thanks,
Lydia Zhang

ankitpatira
Community Champion
Community Champion

@Anonymous I would say you can use table or matrix visual to represent such data and make sure you set fields as Do Not Summarize. This will give you raw data without aggregation. You can also use other visuals which support Do Not Summarize.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors