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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Stelian
Helper I
Helper I

DAX measure - filtering dates

 

I've created a Power BI report linked to a dataset. The table I’m interested in is Actual Sales, which contains Customer RecID, Invoice Date, and a measure [AC TO LCY].

Additionally, I have a manually created table in Power Query using "Enter Data" with the following structure:

Customer RecIDTyp (Rückvergütungsvereinbarung) (Bonus & Gegengeschäft)Startdatum (Rückvergütungsvereinbarung) (Bonus & Gegengeschäft)Enddatum (Rückvergütungsvereinbarung) (Bonus & Gegengeschäft)
555666CMS Ersatzteile & Zubehör01/01/202131/12/2025
555666CMS Verbrauchsgüter & Handwerkzeug01/01/202131/12/2025
555666CMS Schmiermittel01/01/202131/12/2025
666777CMS Ersatzteile & Zubehör01/01/202131/12/2025
666777CMS Verbrauchsgüter & Handwerkzeug01/01/202131/12/2025
666777CMS Schmiermittel01/01/202131/12/2025
 

 

I created a many-to-many relationship between the dataset and this table based on Customer RecID.

I need to calculate the sales value for each customer for all Invoice Dates that fall between Start Date and End Date for specific product groups.

Here is my measure:

 
test = VAR Result = CALCULATE( [AC TO LCY], ProductDim[Product CRM SubGroup Code] IN {"WA-01", "WA-02", "WA-03"}, 'Actual Sales'[InvoiceDate] >= SELECTEDVALUE('CMS customers'[Startdatum]), 'Actual Sales'[InvoiceDate] <= SELECTEDVALUE('CMS customers'[Enddatum]) ) RETURN Result

The filtering on Product CRM SubGroup Code works correctly, but the filtering on Invoice Date does not seem to work as expected.

Can anyone help me understand what might be wrong, please?

Thank you,

Steli

1 ACCEPTED SOLUTION

AC TO LCY =  sum('Actual Sales'[SoldAmount])
The enter data table is called CMS Customers.
 

View solution in original post

3 REPLIES 3
speedramps
Community Champion
Community Champion

Your question is too vague.

Thanks for the example data of the Enter Data table.

PHowvere, you have neglected to provide  the Actual Sale table.

Futhermnore it does not contain the Customer RecID which you say has relationship.

 

Please dont copy and paste your buggy DAX and expect us to know what you require.

 

Please do provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Then a clear step-by-step decscription and use consistent table and field names in the input, output and description.

 

You will get a quick response if you put time, care and effort into writing clear problem descriptions.

 

Thank you

Greg_Deckler
Super User
Super User

@Stelian What is the formula for your AC TO LCY measure? Also, what is that enter data table called?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

AC TO LCY =  sum('Actual Sales'[SoldAmount])
The enter data table is called CMS Customers.
 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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