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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Avivek
Post Partisan
Post Partisan

Need help with the DAX

I am trying to create a measure with the following logic,

If last 1 completed month and the current month is selected then show the Total Exp. Usage Projected for only current month, if last 2 month and current month  is selected then it should show the last completed month and the current month and so on.

The month will be selected by the slicer, another point is if we calculate the last 2 month or last 3 month Total Exp. Usage Projected it should be in a sequence

Is there a way to achieve so.

5 REPLIES 5
Pragati11
Super User
Super User

Hi @Avivek ,

 

You will need to provide details to your query. It doesn't make it clear. refer following:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 

I am using an existing  measure 

Tot. Act. proj. Mon. Usage = [Act. proj. Mon. Usage]+[Act. Last2 Mon Comp.Usage]

 where 

Act. proj. Mon. Usage = ([Act. proj. Usage]/max('DO Vs Tag'[Completed Bus Days]) *max('DO Vs Tag'[Cur Month No of Bus Days]))

Act. Last2 Mon Comp.Usage = CALCULATE(count('DO Vs Tag'[Procedure Credit Owner]), FILTER('DO Vs Tag','DO Vs Tag'[Last 2 Mon Procedure]=1))

The 1st part of the measure that is Act. proj. Mon. Usage will remain as it is. I need to change Act. Last2 Mon Comp.Usage toAct. Last N Mon Comp.Usage where last N month should show the following logics;

  1. When current month and the last completed month is selected then it should show only for the current month. For eg- When Sep and Oct are selected then show only Oct projection as Tot.Proj
  2. When current month and the last 2 months are selected then it should show the current month and the last completed month, Eg.,Aug, Sep and Oct are selected then show Sep+Oct as tot proj.
  3. When current month and last 3 months are selected then it should display Current month and the last 2 completed months. For eg If July, Aug, Sep and Oct is selected, show Aug+Sep+Oct as tot proj.

Hi @Avivek ,

 

Share some input data and the expected output as a sample so that it can be tried at our end.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 ,

Avivek_0-1603802295928.png

I tried to illustrate an example, please let me know if this helps

 

Hi @Avivek ,

 

It can be done, but we really need your sample data for reference. Would you please inform us more detailed information( your sample data and expected output (by OneDrive for Business)) if possible? Then we will help you more correctly.

 

Please do mask sensitive data before uploading.

 

Thanks for your understanding and support.

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors