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! Request now

Reply
Oopa
Frequent Visitor

How to keep measure's value same over time

I'm working data which have two fact_tables called fact_stat and fact_dyn. Fact_stat has only one dimensional date (report_date) and fact_dyn has two dimensional dates (report_date & forecast_date). How I can build a measure which gives me results like in the first picture below? Measure "Dyn_all" should keep fact_stat value same over forecast dates. Measures that I'm using: 

 
Dyn_all = Fact_dyn[Dyn_sum]+Fact_stat[Stat_sum]
Dyn_sum = SUM(Fact_dyn[Amount])
Stat_sum = SUM(Fact_stat[Amount])

Desired_result.JPG

With current measures I can see only results:
Current_result.JPG

Fact_dyn table:

Report_DateForecast_DateAmountPortfolio
30.4.202030.4.2020100A
30.4.202030.4.2020150B
30.4.202030.4.2020200C
30.4.20201.5.2020150A
30.4.20201.5.2020200B
30.4.20201.5.2020250C
30.4.20202.5.2020200A
30.4.20202.5.2020250B
30.4.20202.5.2020300C

 

Fact_stat table:

Report_DateAmountPortfolio
30.4.2020400D
15.5.2020200D

Dataflow:

data_flow.JPG

7 REPLIES 7
v-kelly-msft
Community Support
Community Support

Hi @Oopa

 

According to your request,you'd better first create an appended table as below:

Annotation 2020-05-25 143812.png

Then create a dimension table as below:

 

Table 2 = DISTINCT('Append1'[Portfolio])

 

Finally create 2 measures as below:

 

ReplaceToZero = CALCULATE(SUM('Append1'[Amount]),'Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio]))+0
ReplaceToValue = IF(CALCULATE(COUNTROWS('Append1'),FILTER('Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])))=0,MAXX(SUMMARIZE(FILTER(ALLSELECTED('Append1'),'Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])),'Append1'[Forecast_Date],"measure",CALCULATE(SUM('Append1'[Amount]),FILTER('Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])))),[measure]),'Table 2'[ReplaceToZero])

 

And you will see:

Annotation 2020-05-25 145927.png

For the related .pbix file,pls click here.

 

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

@v-kelly-msft , thank you for your response. I can see correct results from your powerBI. Only minor is that now we are using forecast and report date from Append1 table and not from dim_report_date or dim_forecast_date. Any solution to do that? Otherwise this might cause problems if we want to see other data which is joined also to these dim_report_date and dim_forecast_date tables.

parry2k
Super User
Super User

@Oopa share raw data, you need to have date dimension in your model to make it all work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Oopa
Frequent Visitor

@parry2k , Can I somehow attach powerbi file here?

@Oopa share using one drive / google drive.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Oopa
Frequent Visitor

@parry2k , Example data is quite simple:

 

Fact_dyn:

Report_DateForecast_DateAmountPortfolio
30.4.202030.4.2020100A
30.4.202030.4.2020150B
30.4.202030.4.2020200C
30.4.20201.5.2020150A
30.4.20201.5.2020200B
30.4.20201.5.2020250C
30.4.20202.5.2020200A
30.4.20202.5.2020250B
30.4.20202.5.2020300C

 

Fact_stat:

Report_DateAmountPortfolio
30.4.2020400D
15.5.2020200D

Dataflow:

data_flow.JPG

amitchandak
Super User
Super User

@Oopa , refer how to join two dates to same time dim and use them using userelation

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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