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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
RSD
Helper II
Helper II

DAX

Hi Team,

 

I Would like to show "106.8%" in Card , But unable to write DAX. It should be Avg Forecast Accuracy of Previous months .(March)Dax for Card.PNG

 

Note: All columns are in list are Measures Except Year and Month.

 

Regards,

Rupesh Dhage

 

 
1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @RSD ,

 

We can use the following measure to meet your requirement.

 

Show Last Month = 
CALCULATE (
    [FYTD Avg Accuracy],
    'Table'[date]
        >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, 1 ),
    'Table'[date] < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
)

 

DAX 1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

5 REPLIES 5
v-zhenbw-msft
Community Support
Community Support

Hi @RSD ,

 

We can use the following measure to meet your requirement.

 

Show Last Month = 
CALCULATE (
    [FYTD Avg Accuracy],
    'Table'[date]
        >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, 1 ),
    'Table'[date] < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
)

 

DAX 1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

Hey @v-zhenbw-msft ,

 

It contains time intelligence Calculations of FYTD(Finacial Year to date) and hence it was behaving weird.Even though somehow I managed to get same functionality , but i like your solution. Thanks for your help .Much Appreciated!!.

 

Regards,

RSD

parry2k
Super User
Super User

@RSD there are many ways to achieve this but it is important to what DAX expression is used in  FYTD



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hey @parry2k ,

Please find the DAX calculations for FYTD.

 

FYTD Forecast.PNGFYTD Shipments.PNGFYTD Accuracy.PNG

@RSD , Make sure you use date table for this

YTD QTY forced=
var _max = maxx('Shipmenr + forecast DT',[date].date) //To Stop ytd at max date
return
calculate([shipment Accuracy],DATESYTD('Date'[Date]),'Date'[Date]<=_max)

 

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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.