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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Dynamic development Measure

Hi,

I got a Power BI report and I am trying to automate them. 
It contains some measures which calculates the development of the last 2 years. 

One of the Measure written like shown. 

 

ManthaOrderNumberDevelopment =
IF(
    ISFILTERED('Date'[Date].[Date]),
    ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden."),
    VAR __PREV_YEAR =
        CALCULATE(
            DISTINCTCOUNT('Bericht 1'[Manta Order Number]),
            DATEADD('Date'[Date].[Date], -1, YEAR)
        )
    RETURN
        DIVIDE(
            DISTINCTCOUNT('Bericht 1'[Manta Order Number]) - __PREV_YEAR,
            __PREV_YEAR
        )
)


Inserted this measure into a card allows me to filter it manually for each year.
I inserted a column called "Last year" in the same table which changes every next year and includes always the numbers of the last year. 
 
Last Year Filter = If(year(DataLabelings[Date a Year Ago]) = 'Date'[Year],'Date'[Date].[Date])

I tried to use this column as a filter for my card. So every year the development card will change. 
But when I am trying to use this as a filter my card won't filter.
Only when I am using the normal date column it will work.
And then it is only possible to change the filter manually.

I hope you get my problem, because my english isnt the best and describing the problem is really hard, without showing the report. 
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if you want to display last year of selected value

a measure

last year =

year(maxx(allselected('Date'),'Date'[Date]) ) -1

 

also do not use .date . Please mark your date table as date table

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I started with step one and marked my table as a date table. 
I will continue with the other steps later, but by marking it I lost my hierarchy and now I cant even filter it with my old filter for the seperate year.

 

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.