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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Nina88
Frequent Visitor

Measure from shared dataset don't work in new power bi rapport, only when I added the measure again

I have the following calculation in my Power BI shared dataset ‘klima’:

 

% change MoM/QoQ emissions intensity = var cm = [Carbon intensity scope 1 and 2 tCO2 emissions per MNOK loan total] var pm = CALCULATE([Carbon intensity scope 1 and 2 tCO2 emissions per MNOK loan total], DATEADD(DimDato[Date],-1,MONTH)) var ck = [Carbon intensity scope 1 and 2 tCO2 emissions per MNOK loan total] var pk = CALCULATE([Carbon intensity scope 1 and 2 tCO2 emissions per MNOK loan total], DATEADD(DimDato[Date],-1,QUARTER)) var change_mom = cm - pm var change_qoq = ck - pk var percent_change_mom = DIVIDE(change_mom, pm) var percent_change_qoq = DIVIDE(change_qoq, pk) return if(ISINSCOPE(DimDato[YearQuarter]), percent_change_qoq, if(ISINSCOPE(DimDato[YearMonth]), percent_change_mom, percent_change_qoq))

 

This calculation works perfectly. Now I’ve created a new Power BI report in Power BI desktop where I want to use this formula. However, the formula doesn’t work in the new report, I’m getting a blank result. It seems that it doesn’t understand the time intelligence of DATEADD, even though I have a relationship with the column DimDato[Date] (from a different table, not the shared dataset). How can I solve this?

One solution is to add the exact same measure to my new Power BI report, then I get the expected result. But that means I’ll have to do this for multiple formulas. This not only takes time but also adds more management overhead.

 

I hope someone can help me with this issue

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nina88 , Please make sure there date is selected in the slicer/filter or there is a column from the date tab in the context. Otherwise, dateadd will not be able to find the correct month.

 

 

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-bd52912a5b...
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.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Nina88 ,

@amitchandak Thanks for your concern about this case!

And @Nina88 , I see that the DAX you provided uses many variables such as cm, ck, pk and the like, which is a good habit to get into. You could try returning these variables that you have defined, see which one returns a problematic result, and then modify that variable to try to fix the problem.

Best Regards,
Dino Tao

amitchandak
Super User
Super User

@Nina88 , Please make sure there date is selected in the slicer/filter or there is a column from the date tab in the context. Otherwise, dateadd will not be able to find the correct month.

 

 

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-bd52912a5b...
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.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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