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
Priya1969
Resolver I
Resolver I

Default Date and Full Date visual based on previous month date

My visual has values from January 2020 to December 2023. My requirement is when I open the report want to see the previous month and greater than previous month results. Also, I need the option to see "Full" values from Jan 2020 to December 2023.

I created this Dax query for filter the values, (// Append1 is table name)

 

 Date view = IF(Append1[DATE] >= Append1[Previous_Month].[Date], "Default"IF(Append1[DATE] <= Append1[Previous_Month2].[Date], "Full"))
 
// Previous Month Dax is 
Previous_Month = EOMONTH(NOW(),-2)+1
 
1. My 1st option is fulfilled. It shows the results from Previous month to end of December 2023.
yanjaga_0-1671821241111.png

 

2. When I select the Full option it shows up tp 10/1/222 from January 2020. Beacuse I gave <= previous month.

yanjaga_1-1671821372714.png

But, when I select "Full", I want to show upto December 2023. I don't know how to fulfill. Tried multiple ways, missing somewhere. What extra query I need to add here? Can someone help me solve this?

Thanks!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Priya1969 

 

You can try the following methods.

Measure = IF(SELECTEDVALUE('Table'[Date])<=[Previous_Month],1,0)

vzhangti_0-1672027245548.png

This is the default date.

 

The full date is displayed when this measure is cleared.

vzhangti_1-1672027304878.png

Hope this method helps you.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Priya1969 

 

You can try the following methods.

Measure = IF(SELECTEDVALUE('Table'[Date])<=[Previous_Month],1,0)

vzhangti_0-1672027245548.png

This is the default date.

 

The full date is displayed when this measure is cleared.

vzhangti_1-1672027304878.png

Hope this method helps you.

 

Best Regards,

Community Support Team _Charlotte

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

Hi, Thanks for the reply. It's almost correct. Instead of giving measures in 'fiters on this visual' option, I did something like this. 

Date View = IF(Append1[DATE] >= Append1[Previous_Month].[Date] ,"Default","Other_Dates")
 
Then, in the format, slicer selection, on the 'Select all" option. Then it will show like this.
 
Priya1969_0-1672252327101.png

If i select, 'Select all' option, it shows all the dates. 

 

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.