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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.

View solution in original post

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

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.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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