Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Apologies if this has been answered before, I have tried to google it but I'm not sure how to pose the question.
My issue is this:
Say I have several measures that need to do the same thing, on different data sources.
Example would be
Revenue = CALCULATE ( SUM ( column1 ) ,
DATESBETWEEN ( calendar , DATE ( 2019,01,01 ) , DATE ( 2019,02,01 )
))
What I would like to do is to create the DATESBETWEEN filter as it's own variable, seperate from the measure so that, in the eventuality that the DATESBETWEEN period needs changing, I would only need to change it once, not for every measure. Something like below is what I had in mind.
Period = DATESBETWEEN ( calendar , DATE ( 2019,01,01 ) , DATE ( 2019,02,01 ) )
Revenue = CALCULATE( SUM ( column1 ) , [Period] )
Many thanks,
Solved! Go to Solution.
Revenue = CALCULATE( SUM ( column1 ), TREATAS ( Period, 'Date'[Date] ) )
Regards,
Owen
Revenue = CALCULATE( SUM ( column1 ), TREATAS ( Period, 'Date'[Date] ) )
Regards,
Owen
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
26 |
User | Count |
---|---|
95 | |
50 | |
43 | |
40 | |
35 |