Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am using the below measure to calculte the variance between premium current month to previous month.
Is there a way to change the DAX to get the previous month for the first month in the filter context , or do I need to add a column for the data in my model?
Solved! Go to Solution.
Have you tried using:
DATEADD: https://dax.guide/dateadd/
For example
Sales Previous Month = CALCULATE( [Sales], DATEADD(DimDate[FullDateAlternateKey],-1,MONTH) )
PARALLELPERIOD might help, too: https://dax.guide/parallelperiod/
Have you tried using:
DATEADD: https://dax.guide/dateadd/
For example
Sales Previous Month = CALCULATE( [Sales], DATEADD(DimDate[FullDateAlternateKey],-1,MONTH) )
PARALLELPERIOD might help, too: https://dax.guide/parallelperiod/
Hi: I am trying to write a DAX expression that returns the value of the Avg Prem measure for a month that is NOT in the current fitler context.
Our organization has a table called Standard Date that returns a max and min value for a date range selected by the user in the filter pane.
Dax calculations then use the Min and Max values of this table to limit the calculations of measures to the dates selected.
What I would like to be able to do is calculate the value of a measure within my dax statement for the month BEFORE the first one that is currently selected.
I tried the below code.
I thought the calculate function allowed you to override the filter context that is selected by a visual, but I guess not in this case. Is there a way to calculate the value of [Avg Prem] within this Dax statement for Dec of 2021?
@mjanecek Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |