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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GabrielaD
Frequent Visitor

How to show the yearly saving when I have as date range the contract start and end date

Hello PBI experts 🙂 

 

I am a begginer in Power BI and I struggling with a topic, searched for answeres but I found myself stuck as nothing that I've tried helped me.

In my Report I have the annual savings, and I want to show it for every contractual year, but the only date range that I have is the start and end date of the contract.

 

I created a calendar using this measure: 

Calendar = CALENDAR(MINX('Awarding report_Global',[Contract_Start (mm/dd/yyyy)]),MAXX('Awarding report_Global',[Contract_End (mm/dd/yyyy)])) 

 

Consequently, it's showing me the annual saving only in the last contractual year.

 

Could you provide your advice? Again, I am a beginner and don't have so much DAX knowledge 🙂 

 

Thank you!

 
4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @GabrielaD ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

Hi @v-luwang-msft ,

 

Thank you for your message. The problem hasn't been solved, and I still cannot find a solution for it.

Consequently, I cannot accept any current replies as a solution.

 

Best regards,

Gabriela

GabrielaD
Frequent Visitor

@amitchandak thank you very much for your quick response!

 

I tried creating above measure but I receive the following error : The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

 

Do you have any idea why? 😞

 

amitchandak
Super User
Super User

@GabrielaD , Create one like

 

Calendar =
var _min1 = MINX('Awarding report_Global',[Contract_Start (mm/dd/yyyy)])
var _max1 = MAXX('Awarding report_Global',[Contract_End (mm/dd/yyyy)])
var _min = eomonth(_min1, -1*month(_min1))+1
var _min = eomonth(_max1, 12-1*month(_max1))+1
return
Calendar = Addcolumns(calendar(_min, _max), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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