The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 !!
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |