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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tlotly
Resolver II
Resolver II

Measure to return only current year values on a chart

Good day

Please help. I have a conditional measure  where I need to return only current  fin year values on the visual if there is nothing selected on the Fiscal Year slicer. The dates I'm working with are fin dates i.e. July to June. With help from the forum, I managed to create a measure returning current fin year but I'm struggling to use the same measure in an if statement. 

 

Here is the measure below and if I return just variables I get correct values but when I return the if statement I get values for all the fin years:

      Measure 3 = VAR vCurrentFiscalYear = CALCULATE ( MAX ( 'Calendar'[Fiscal Year] ), year('Calendar'[Date] = TODAY ()))
                      VAR vScoring =
                                   IF (
                                  ISFILTERED ('Calendar'[Fiscal Year]),
                                   [WeightedErrorsCY],
                                 CALCULATE ( [WeightedErrorsCY], 'Calendar'[Fiscal Year] = vCurrentFiscalYear )
                                      )

                  RETURN
                         If(vScoring < 1 ,"Exceptional",
                          If((vScoring >= 5.25 && vScoring <= 11.75) , "Off Track",
                            If((vScoring> 1 && vScoring < 5.25) , "On Track",
                             If(vScoring >1 , "Disciplinary Action"
))
))
 
 
So basically when I haven't selected  a year, I need to see the results as below:
Tlotly_0-1626344002388.png

 

1 ACCEPTED SOLUTION

Hi @Tlotly ,

 

Silly question, but is there a reason why you aren't using your original measures and just applying a visual-level filter to your table to exclude blank values of your measures?

 

I'vejust checked your PBIX, and applied a visual-level filter to your table of [WeightedErrorsCY] is not blank, and I get the following ouput:

BA_Pete_0-1626353456204.png

 

This is what you want, right?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @Tlotly ,

 

Add a clause into your measure for what to return if nothing is filtered on the slicer, along the lines of:

IF(
  NOT ISFILTERED(calendar[Fiscal Year]),
  [CY Measures],
  ...other possible inputs/outputs
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@BA_Pete thank you and I get what you mean. I've tried doing that, actual problem is on the [CY Measure] part. I'm struggling to replace [CY Measure] with the condition in order to execute only for the current year. 

 

If(vScoring < 10 ,"Exceptional",
If((vScoring >= 50.25 && vScoring <= 119.00) , "Off Track",
If((vScoring> 10 && vScoring < 50.25) , "On Track",
If(vScoring >120 , "Disciplinary Action"
))
))

Hi @Tlotly ,

 

Silly question, but is there a reason why you aren't using your original measures and just applying a visual-level filter to your table to exclude blank values of your measures?

 

I'vejust checked your PBIX, and applied a visual-level filter to your table of [WeightedErrorsCY] is not blank, and I get the following ouput:

BA_Pete_0-1626353456204.png

 

This is what you want, right?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@BA_Pete  okay thanks. If you remove Measure3 and look at the other 2 measures on the visual, you'll see they work perfectly without putting on a visual filter . I guess that's why I thought I could do the same for Measure 3. I'm new to Power BI so sometimes I tend to think everything must be done on DAX...lol. I'll use the visual filter then, thank you. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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