Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi there,
I have a relatively complicated model where a number of measures relate to each other. For simplicites sake though, I can relate my problem as follows:
On a fiscal calendar of July to June, I have a measure TotalSales for each month which sums the total amount of sales recorded throughout the entire month (sales transactions recorded on any number of days within that month).
I now wish to divide each subsequent month's TotalSales by the first month's TotalSales to guage the variance.
In trying to capture the firt month's sales, I have the below measure with [First Sales Month Start] and [First Sales Month End] as 2 additional measures returning the dates of "01 July 2018" and "31 July 2018".
First Month Total Sales= CALCULATE( [TotalSales], DATESBETWEEN( 'Calendar'[Date], [First Sales Month Start], [First Sales Month End] ) )
While the above code doesn't give me any errors, it simply doesn't return any values.
Solved! Go to Solution.
@wi11iamr not sure how you are calculating first month start and end date. Can you replace these with fixed value to see if this measure works which will and that will tell the measure you are using to start and end date need revisit.
to use fixed value replace start and end date with date( 2018, 07, 01 ), date(2018, 07, 31)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@wi11iamr not sure how you are calculating first month start and end date. Can you replace these with fixed value to see if this measure works which will and that will tell the measure you are using to start and end date need revisit.
to use fixed value replace start and end date with date( 2018, 07, 01 ), date(2018, 07, 31)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks @parry2k, the measure now works when using the fixed vallue dates as you suggested.
With a little more tinkering and investigative snooping, I found my mistake in the below code - it's quite laughable actually, as the "Start Date" I had mistakenly recorded as 31, instead of 1 and vice versa in the "End Date".
Thanks for your quick response and suggested path of investigation.
First Sales Month Start = VAR FirstFiscalMonth = 7 /* Set the first month of the fiscal year */ VAR LastDay = MIN ( 'Calendar'[Date] ) VAR LastMonth = MONTH ( LastDay ) VAR LastYear = YEAR ( LastDay ) - IF ( LastMonth < FirstFiscalMonth, 1 ) VAR FilterYtd = DATE ( LastYear, FirstFiscalMonth, 31 ) RETURN FilterYtd
@wi11iamr awesome good for you.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
142 | |
80 | |
64 | |
52 | |
48 |
User | Count |
---|---|
212 | |
89 | |
79 | |
68 | |
60 |