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.
Hi team,
i'm trying to display total sales target of the current quarter (Q2) using card,
but also if i choose another month (ex : August), it will show total quarter target in that month (Q3)
**I used this measure and it show the first quarter not the current quarter as default,
TargetQuarter =
VAR _q = MIN(MASTER[Quarter Column])
return
CALCULATE(SUM(MASTER[Sales Target]), FILTER(ALL(MASTER),MASTER[Quarter Column]=_q))
**If i used this measure, the default will show current quarter, but if i click June it will show that month target not the Q2 target, and if i choose August it will give blanks result
Var _Quarter = QUARTER(TODAY())
return
CALCULATE(SUM(MASTER[Sales Target]),(MASTER[QuarterColumn]=_Quarter)
please help with my measure
thankyou
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@amitchandak
i have column chart that show target in every month,
with this detail :
_DATE | TARGET |
1-Jan-2023 | 20 |
2-Jan-2023 | 10 |
16-Feb-2023 | 40 |
20-Apr-2023 | 50 |
22-Apr-2023 | 10 |
15-May-2023 | 20 |
2-Jun-2023 | 40 |
5-Jun-2023 | 30 |
12-Jul-2023 | 60 |
25-Aug-2023 | 10 |
i need the visual in 1 card that shows this quartal target (Q2) it means the card will show 150,
when i click Jul-23 on column chart, the card will show 70 (Q3 target in total)
Hi,
You may download my PBI file from here.
Hope this helps.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@Oki , Try like
QTD Today =
var _max = today()
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
QTD Yesterday =
var _max = today()-1
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LQTD Today =
var _max = Date(year(today()), Month(Today())-3, day(today()))
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LYQTD Today =
var _max = Date(year(today())-1, Month(Today()), day(today()))
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
This Qtr Today =
var _today = today()
var _max = eomonth(_today, if( mod(Month(_today),3) =0,0,3-mod(Month(_today),3)))
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Last Qtr Today =
var _today = today()
var _max = eomonth(_today, -1*if( mod(Month(_today),3) =0,3,mod(Month(_today),3)))
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Same Qtr Last Year Today =
var _today = today()
var _max = eomonth(eomonth(_today, if( mod(Month(_today),3) =0,0,3-mod(Month(_today),3))),-12)
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
First Qtr This year Today =
var _min = eomonth(today(),-1*month(Today()))+1
var _max = eomonth(_min,2)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Last Qtr Last year Today =
var _max = eomonth(today(),-1*month(Today()))
var _min = eomonth(_max,-3)+1
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
95 | |
94 | |
80 | |
71 | |
64 |
User | Count |
---|---|
115 | |
106 | |
96 | |
81 | |
72 |