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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
paulinamaj
Frequent Visitor

Dateadd + another hierarchy

Hi,

I made a measure that calculates the% change between the previous month, quarter, year.

% Change Units = 

VAR CurrentValue = 'Sales Ths Units'[Total Sales Units]

VAR PreviousValue =

SWITCH(

TRUE(),

ISINSCOPE('Timedimension'[Date].[Day]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, DAY)),

ISINSCOPE('Timedimension'[Date].[Month]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, MONTH)),

ISINSCOPE('Timedimension'[Date].[Quarter]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, QUARTER)),

ISINSCOPE('Timedimension'[Date].[Year]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, YEAR))

)

RETURN

DIVIDE(

CurrentValue - PreviousValue,

PreviousValue)


It work when I use on a graph automatic date hierarchy from PowerBi.

 

Now I have to add another hierarchy with date on the graph (I cant use date hierarchy from PowerBI):

paulinamaj_0-1623923117103.pngpaulinamaj_1-1623923155134.png

 

 

When I added this hierarchy my value : "% Change Units" is blank on the graph. 

How I can fix it? Thanks!

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi  @paulinamaj ,

 

I guess your measure doesnt contain the hierarchy you added in,that's why you see blank results.You need to add the hierarchy in your measure.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Top Kudoed Authors