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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jhadur
Helper I
Helper I

Calculate number from today to end of year

Hi,

 

I am new to Power BI. I need to calculate the number of business cases remaining from "today" to the end of the fiscal year, Oct. 31st.

 

BC Gate Status is the table with BCDC MONTH holding the dates of the business cases and INITIATIVE NAME being the name of the business case.

Jhadur_0-1718039705644.png

CA PPM REFERENCE # INITIATIVE NAME BCDC MONTH

IDE-00012580	BC 1	March, 2024
IDE-00010932	BC 2	April, 2024
IDE-00014835	BC 3	May, 2024
IDE-00014841	BC 4	June, 2024
IDE-00014820	BC 5	June, 2024
IDE-00012729	BC 6	June, 2024
IDE-00014243	BC 7	July, 2024
IDE-00011566	BC 8	July, 2024
IDE-00014788	BC 9	July, 2024
IDE-00014792	BC 10	July, 2024
IDE-00014802	BC 11	October, 2024
IDE-00014826	BC 12	October, 2024
IDE-00012712	BC 13	October, 2024
IDE-00014791	BC 14	October, 2024
IDE-00014837	BC 15	November, 2024

 

1 ACCEPTED SOLUTION

@Jhadur Where the red squigly line begins, remove the ", ". Well, should be able to remove the "'BC Gate Status', " entirely. Just the [BDCD MONTH] <= __MaxDate after the &&



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

@Jhadur Is BDC Month a date or text?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

It is a date.

@Jhadur OK:

Measure =
  VAR __MinDate = TODAY()
  VAR __MaxDate = DATE( YEAR( __MinDate ), 10, 31 )
  VAR __Table = FILTER( 'BC Gate Status', [BCDC MONTH] >= __MinDate && [BDC MONTH] <= __MaxDate )
  VAR __Result = COUNTROWS( __Table )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg! I am getting this error with the measure. Any idea how I can fix that?

Jhadur_0-1718047443517.png

Jhadur_0-1718049627625.png

 

@Jhadur Where the red squigly line begins, remove the ", ". Well, should be able to remove the "'BC Gate Status', " entirely. Just the [BDCD MONTH] <= __MaxDate after the &&



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

There are two things, based on the post, 

I believe you have to paste only once and you have shared 2 images.

 

Check what @Greg_Deckler  pasted the code 

 

it should be somewhat like:

 

sevenhills_0-1718056082354.png

 

 

@sevenhills @Greg_Deckler 

I did only paste once in Power BI. I pasted 2 images here to show both of the issues I am having. First is that Power BI won't recognize the 2nd [BCDC MONTH] in the formula. I get an unexpected parameter and cannot find name. The second image shows the error in yellow that I get on the whole formula.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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