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
Saloni_Gupta
Helper I
Helper I

To show Prior Year values for only Current Fiscal Year

Hi All,

I have created a Dax logic to calculate prior year values as below :
FY Prior Year Values=

var maxDate_PY = CALCULATE(Max('MP'[Date]),DATEADD(('MP'[Date]),-1,YEAR))
RETURN
 CALCULATE(SUM(MP[PTD_Actual]),
 'MP'[Date] = maxDate_PY)

It gives me correct result for all the Dates. Now, I just want to show these values for Current FY Year, how can I do that (like FY Values in the screenshot)?
I simply used Current Year flag for FY values but Prior values logic does not work with Current year flag
FY Values= CALCULATE(SUM('MP'[PTD_Actual])
    ,'Month Table'[Current FY Flag] = "Y"

Saloni_Gupta_0-1713553893356.png

Can you please help filtering these values for only Current FY (in DAX) ?

Thanks in Advance!

1 ACCEPTED SOLUTION
quantumudit
Continued Contributor
Continued Contributor

Maybe you can try this:

FY Prior Year Values (New) = IF(ISBLANK([FY_Values]), BLANK(), [FY Prior Year Values])

Let me know if it solves your issue.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

View solution in original post

3 REPLIES 3
v-jianpeng-msft
Community Support
Community Support

Thanks solutions from @Ashish_Mathur and @quantumudit , your solutions is great!

Hi, @Saloni_Gupta 

You can put your FY Values measure into a Filter pane visual filter and set it to non-null. I created a sample as follows:

I have two measures, value_1 and value_2, and there are some empty items in the value_1.:

vjianpengmsft_0-1714024017468.png

I put the value_1 measure in the Filter pane next to it and set it to "is not blank"

vjianpengmsft_1-1714024128901.png

The results are shown in the figure below:

vjianpengmsft_2-1714024293078.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

Try this approach

  1. Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number
  2. Create a relationship (Many to One and single) from the Date column of your Data Table to the Date column of the Calendar Table
  3. to your matrix visual, drag Month name to the Row labels and year to the column labels
  4. Write this measure

Total = sum(Data[Amount])

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
quantumudit
Continued Contributor
Continued Contributor

Maybe you can try this:

FY Prior Year Values (New) = IF(ISBLANK([FY_Values]), BLANK(), [FY Prior Year Values])

Let me know if it solves your issue.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.