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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
13havya
Frequent Visitor

Aggregating multiple variables in DAX measure

Hi,

 

I am trying to build a measure that contains a couple of variables, and I need the totals row to be the sum of all values in the visual. 

 

The logic behind the metric - 

The business records a "cutoff" dataset on the 9th of every month. The cutoff dataset has a record of files opened in the past month (i.e cutoff recorded on 9 May will contain data for files opened in April).

 

I want to design the measure such that: 

 

 

Cutoff Files = 

IF(

DAY(TODAY) < 9,
RETURN CUTOFF (till 2 months ago) + live data from files opened in last month

)

 

This will ensure that all data till the previous month gets populated, regardless of whetehr the cutoff point has been reached or not. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @13havya ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1717744479769.png

2.Create the new measure to calculate.

Cutoff files = 
var last_month = CALCULATE(SUM('Table'[Files]), FILTER('Table', MONTH('Table'[Date]) = MONTH(TODAY()) - 1))
VAR two_months = CALCULATE(SUM('Table'[Files]), FILTER('Table', MONTH('Table'[Date]) < MONTH(TODAY()) - 2))
RETURN
IF(DAY(TODAY()) < 9, last_month + two_months)

3.Drag the measure into the card visual. The result is shown below.

vjiewumsft_1-1717744493346.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @13havya ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1717744479769.png

2.Create the new measure to calculate.

Cutoff files = 
var last_month = CALCULATE(SUM('Table'[Files]), FILTER('Table', MONTH('Table'[Date]) = MONTH(TODAY()) - 1))
VAR two_months = CALCULATE(SUM('Table'[Files]), FILTER('Table', MONTH('Table'[Date]) < MONTH(TODAY()) - 2))
RETURN
IF(DAY(TODAY()) < 9, last_month + two_months)

3.Drag the measure into the card visual. The result is shown below.

vjiewumsft_1-1717744493346.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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