cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
brian0782
Frequent Visitor

Calculate SUM up to Quarter end using existing Date table

Hi

 

Newbie to DAX here 🙂

 

We have an existing Accounting Period dimension and this is joined to the Gross (Fact) on accounting_period:

 

 

brian0782_2-1605779017291.png

 

I am using Quarter Name as a slicer and the Quarter Name values appear as below:

 

brian0782_4-1605779353327.png

 

 

I have this Measure that gives me the total Gross Premium but I'd like this total to be up to the end of the Quarter Name.

So SUM the Gross Premium for values <= Quarter Name

 

brian0782_5-1605779671440.png

 

 

I can do this in SQL but wondering how to achieve this in DAX. Any help would be appreciated

 

Thanks

 

 

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@brian0782 , Try like

measure =
var _max = maxx(allselected(period), period[Qtr name]) //you can use numeric Year Qtr No too, in place qtr name
return
calculate([measure], filter(all(period),period[Qtr name] <=_max))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
amitchandak
Super User IV
Super User IV

@brian0782 , Try like

measure =
var _max = maxx(allselected(period), period[Qtr name]) //you can use numeric Year Qtr No too, in place qtr name
return
calculate([measure], filter(all(period),period[Qtr name] <=_max))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors