March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi Community..!!
I want to display first month of the year where i will be selecting the month from slicer.
Ex : I have selected Dec-23 from slicer then first month for Dec-23 is Jan-23
If i have selected Mar-23 from the slicer then first month for Mar-23 will be Jan-23 and so on..
I want to display it in card visual.
How do we do it by writing DAX.
could u please help me to resolve this.
Thanks in advance..!!
Solved! Go to Solution.
Hi @PatilPrasad027 , Hello @amitchandak ,Thank you for your prompt reply.
Based on my understanding, you want to display date in the first month of the year when you select different dates in slicer.
Per my test, we can create a Measure to display target date in Card visual as shown below:
Measure = VAR firstMonthofYear="Jan"
VAR currentday=DAY(SELECTEDVALUE('Table'[Date]))
Return
CONCATENATE(firstMonthofYear,CONCATENATE("-",currentday))
Please note that I changed the slicer as Vertical list and check the Single select on:
Result for your reference:
Best Regards,
Joyce,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PatilPrasad027 , Hello @amitchandak ,Thank you for your prompt reply.
Based on my understanding, you want to display date in the first month of the year when you select different dates in slicer.
Per my test, we can create a Measure to display target date in Card visual as shown below:
Measure = VAR firstMonthofYear="Jan"
VAR currentday=DAY(SELECTEDVALUE('Table'[Date]))
Return
CONCATENATE(firstMonthofYear,CONCATENATE("-",currentday))
Please note that I changed the slicer as Vertical list and check the Single select on:
Result for your reference:
Best Regards,
Joyce,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@PatilPrasad027 , What I am getting, you need YTD, year till date. then you can use Time intelligence
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
YTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1*MONTH(_max))+1
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi @amitchandak
Thanks for the quick responce..!!
I do not need YTD
Just i need to display month in the card visual.
I have explained my requirement in details in my question.
Thanks
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
126 | |
79 | |
59 | |
58 | |
44 |
User | Count |
---|---|
181 | |
121 | |
82 | |
70 | |
54 |