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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mitchblue006
Advocate I
Advocate I

Visualization not working with Date Range Slicer

Hi Everyone

 

I am building a dashboard with visuals that will ...
1) Allow the user to have a rev counter visual that shows previous and current month measure
2) User can manipulate date Slicer for any range on the dashboard

Mitchblue006_0-1675775283659.png

Here...above...the visuals look good...since I use DAX in summary table to link to rev counters with TODAY()...

However, if I change the date slicer range to previous dates (I have rev counters that don't know which date to classify previous and current months)- I read previous forums...and I replaced TODAY() with MAX(Date'Date') and does not work...repeat...does not work

Mitchblue006_1-1675775476817.png

Here above...is the problem with date selector as slicer...this is a bad visual

I will attach some of the DAX from the Summary Table that connects to the Rev Counters visual...

SummaryCancel = SUMMARIZE(Subscriptions, [CancelledSubscriptions].[Date],"Cancelled Subs",COUNT(Subscriptions[CancelledSubscriptions]),"Cancelled Profiles",SUM(Subscriptions[Number of Profiles]),"Revenue(Cancelled Profiles)",SUM(Subscriptions[Amount])/100,"IsCurrentMonth",
    IF (
        YEAR ( Subscriptions[CancelledSubscriptions].[Date] ) = YEAR ( TODAY() )
            && MONTH ( Subscriptions[CancelledSubscriptions].[Date] ) = MONTH ( TODAY() ),
        "Yes",
        "No"
    ),"IsPreviousMonth",
    IF (
        YEAR ( Subscriptions[CancelledSubscriptions].[Date] ) = YEAR ( TODAY() ) 
            && MONTH ( Subscriptions[CancelledSubscriptions].[Date] ) = MONTH ( TODAY() ) - 1,
        "Yes",
        "No"
    ))

Thanks for helping out!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Mitchblue006 , Try measures like

 

This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

 

Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Mitchblue006 , Try measures like

 

This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

 

Last Month =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = eomonth(_max1,-1)
var _min = eomonth(_max1,-2)+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.