The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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
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!
Solved! Go to Solution.
@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))
@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))
User | Count |
---|---|
86 | |
84 | |
36 | |
34 | |
30 |
User | Count |
---|---|
92 | |
79 | |
66 | |
55 | |
52 |