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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mb0307
Responsive Resident
Responsive Resident

YTG total % incorrect but correct for Last year

Hi all,

 

DATA DOWNLOAD 

 

I have a measure that functions properly when the table is filtered for last year (2022).

 

But, for the Current Year (2023), I only intended to display % using the same measure while omitting YTG months.

 

 

Accuracy = 
VAR Result = 1-( DIVIDE( [Variance Month], [Sales], 0 ) )
VAR MonthSelect = IF(AND(SELECTEDVALUE(dimDate[Year]) >= YEAR(TODAY()), SELECTEDVALUE(dimDate[Month]) >= MONTH(TODAY())),0,1)
RETURN
IF( MonthSelect = 1, Result, "-")

 

 

 

Not getting correct values as Total based for 2023 using above measure.  Current Year total should ignore YTG (or - in this case)

2023.jpg

 

BUT for 2022 ALL correct:

2022.jpg

 

Thanks 

 

3 REPLIES 3
Greg_Deckler
Super User
Super User

@mb0307 Difficult to say without mocking things up. Any chance you can share the PBIX? Could be a measure totals problem but not sure. First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8


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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  Thanks Greg.  

 

PBIX download link is provided in the post. 

 

DOWNLOAD PBIX 

Please check if you can help with a measure called Accuracy.  

 

Thanks in advance. 

@mb0307 Ah, so the issue is that you are including Forecasted values for 2023 for future months. So that is what is throwing your calculations off for the current year. You will need to modify your Forecast measure to only sum the values that are < TODAY(). You can do this with a SUMX and a FILTER statement. 


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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.