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

Not working: sum based on selected slicer values and additional criterias

Hi,
 
Want to create a measure to sum previous year's values. Previous year should be equal to selected year in slicer subtracted by 1. Years, months and days are numbers formatted as text in my data-sets; 2023... 01... 31... Tried the expression below but it is returning error. If slicer= 2023, then this measure should generate all values for 2022. Appreciate all help on this, thanks.
 
measure_SumPreviousYear = 
CALCULATE(
SUM(facts_general_ledger[values]),
SELECTEDVALUE(dim_calendar[year])-1)
 
Returning error: The True/False expression does not specify a column. Each True/False expressions used as a table filter express must refer to exactly one column
1 ACCEPTED SOLUTION

Thanks for your response mate.

 

The following DAX solved the issue:

CALCULATE(

    SUM(facts_general_ledger[values]]),

    FILTER(

        ALL(dim_calendar),

        VALUE(dim_calendar[year]=SELECTEDVALUE(dim_calendar[year])-1

    )

)


View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Mjolnir You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 

Also:



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for your response mate.

 

The following DAX solved the issue:

CALCULATE(

    SUM(facts_general_ledger[values]]),

    FILTER(

        ALL(dim_calendar),

        VALUE(dim_calendar[year]=SELECTEDVALUE(dim_calendar[year])-1

    )

)


Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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