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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pawelj795
Post Prodigy
Post Prodigy

Verifying customers declaration - turnover

Hi,
I'm currently working on creating a report page that will show the realization of customers declaration about turnover.
If they carry out a promise, they will get a proper discount.

 

CustomerStart DateEnd DateDeclared Turnover for periodActual Turnover for period *Realization (%)
A01.01.202031.12.2020500 000100 000?
B01.01.202031.12.2020300 000200 000?
C01.01.202031.12.2020400 000500 000?

 

*Actual Turnover are calculating correctly from the FACT table

 

The above table was created manually in Excel (only actual turnover was added in Power BI).

My problem is that I don't know how to connect Start & End Date to Date Table, that if I put a slicer on my report page and filter for example Q1 2020, the Declared Turnover will be adequately divided (in this case divided by 4).

 

image.png

1 ACCEPTED SOLUTION

6 REPLIES 6
AllisonKennedy
Super User
Super User

I need a bit more info, but if I understand your problem correctly, then add a Measure for Period Duration which calculates the DATEDIFF between the max value of End Date or Date Selected and min value Start Date or Date Selected. Divide the Declared Turnover for Period by that measure.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy 
Another problem is that both dates (Start & End) must be inactive relationships.

What else do you need for helping me?

@pawelj795 , see my update above helps.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak
Thanks for your solutions, but they are quite different than my case.

Below my sample data.

https://drive.google.com/file/d/1TZdTBmvU2J72w15ULnQTlLqeJQjr4vz5/view?usp=sharing

As you can see on my file, when I filter data on my page, the declared turnover don't change, and I want to divide it according to days spent. (for example, if I choose Q2, it should be shown only declared turnover * 180/360)
 

@pawelj795 , Check if this can help

 

amitchandak
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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