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
Vettesnack
Regular Visitor

The total for same period last year is incorrect

Hi Guys,

 

I am new to Power BI and I have some issues with my current dashboard.

 

Please see the screen shot below:

Vettesnack_0-1643056530565.png

 

In the current year for two dates there was no revenue registered for two dates 16-1-22 and 23-1-22. I did some research on the Power Bi forum on how to solve this, but I did not manage to find how I can solve this type of issue. The "Omzet YTD Last Year" is the correct. 

 

The DAX formulas which I use are the following:

 

Omzet Last Year =
CALCULATE([0. Bruto Omzet], dateadd('Date Table'[Datum],-1,year))  --- SAMEPERIODLASTYEAR() gives the same issue

 

Omzet Vorig Jaar =
VAR DataMaxDate =
CALCULATE ( MAX ( 'Sales Orders Full'[Order Date] ), ALL ( 'Sales Orders Full') )
RETURN
CALCULATE (
SUMX( 'Sales Orders Full', 'Sales Orders Full'[Gross_Revenue]),
SAMEPERIODLASTYEAR(
INTERSECT (
VALUES ( 'Date Table'[Datum] ),
DATESBETWEEN ( 'Sales Orders Full'[Order Date] , BLANK (), DataMaxDate )
)
)
)
 
I use a date table with the first date in the fact table untill today. This table is marked as date table. 
 
Can someone please explain to me:
Why the values in the field Omzet Last Year are correct but the total sum is incorrect?
Why the values in the field Omzet Vorig Jaar misses the 4036 on 16-1 in the total sum?
How I can solve this issue in the future?
 
I would be verry gratefull if someone can explain my problem and help me to solve this. 
 
 
1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @Vettesnack 

 

For question 1, I think this post by @Greg_Deckler explains the issue you are having: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

For question 2, it may have something to do with the nature / way you are using the second measure.  If you refer to the above blog by Greg, you should find it resolves the first question and nullifies the second question.  

 

Hope this helps!


Theo 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

2 REPLIES 2
TheoC
Super User
Super User

Hi @Vettesnack 

 

For question 1, I think this post by @Greg_Deckler explains the issue you are having: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

For question 2, it may have something to do with the nature / way you are using the second measure.  If you refer to the above blog by Greg, you should find it resolves the first question and nullifies the second question.  

 

Hope this helps!


Theo 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Thanks a lot Theo this explains my problem

 

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.