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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Display dimension member (current month)

I have a date dimension including two attributes: IsCurrentMonth (Yes/no) and YearMonthNumber (2021-01, 2021-02)

I want to present the current month (2021-06) in the title of the report and would like to create a measure/calculated column that present the current month base on a filter on the IsCurrentMonth Attribute (column)

Is that possible?

1 ACCEPTED SOLUTION

@Anonymous You could try 

SELECTEDVALUE( 'tablename'[YearMonthNumber] )

or 

CALCULATE(SELECTEDVALUE('tablename'[YearMonthNumber]),'tablename'[IsCurrentMonth] = "Yes")

or 

CALCULATE(MAX('tablename'[YearMonthNumber]),'tablename'[IsCurrentMonth] = "Yes")

 

Regards,

Jing

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

To present the current month in the title of the report, you could create below measure to get the current month and put it in a card or text box or something else which can accept a measure.

Current Month = YEAR(TODAY())&"-"&RIGHT("0"&MONTH(TODAY()),2)

or

Current Month = FORMAT(TODAY(),"yyyy-mm")

 

 

For the second requirement, I'm not clear what your expected result should be. Could you explain it more clearly (maybe by using some data)?

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Anonymous
Not applicable

thanks, I would like to calculate from ther other column (IsCurrentMonth) awhich not always is the same as the "real" calender currentmonth

@Anonymous You could try 

SELECTEDVALUE( 'tablename'[YearMonthNumber] )

or 

CALCULATE(SELECTEDVALUE('tablename'[YearMonthNumber]),'tablename'[IsCurrentMonth] = "Yes")

or 

CALCULATE(MAX('tablename'[YearMonthNumber]),'tablename'[IsCurrentMonth] = "Yes")

 

Regards,

Jing

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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