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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Sonalim
Frequent Visitor

DAX error

calculate(COUNTX(TBL_DTL_PURC_REQUISITIONS,TBL_DTL_PURC_REQUISITIONS[Requisition_Code]), filter( TBL_DTL_PURC_REQUISITIONS,TBL_DTL_PURC_REQUISITIONS[Requisition_ID] in (SUMMARIZE('TBL_DTL_PURC_REQUISITIONS','TBL_DTL_PURC_REQUISITIONS'[Requisition_Code],"Ct_Req",max('TBL_DTL_PURC_REQUISITIONS'[Requisition_ID]))) && TBL_DTL_PURC_REQUISITIONS[Doc_Type] =87))

I am using this measure for caculation of count requisition code where i have to grp by the table with requisition code an dthen tofind maximum rqstn -id wrt to rqstn-code and after then filter condition like do-type 87 

But getting with the same dax,

Confused how to do this 

can any body help ?

 

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

Hi  @Sonalim ,

 

You can try the following dax:

Measure =
var _maxID=
MAXX(
    ALL('Table'),'Table'[Requisition_ID])
RETURN
COUNTX(
    FILTER(ALL('Table'),
    'Table'[Requisition_ID]=_maxID&&'Table'[Doc_Type]=87),[Requisition_Code])

vyangliumsft_0-1700531294466.png

If it doesn't meet your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Sonalim ,

 

You can try the following dax:

Measure =
var _maxID=
MAXX(
    ALL('Table'),'Table'[Requisition_ID])
RETURN
COUNTX(
    FILTER(ALL('Table'),
    'Table'[Requisition_ID]=_maxID&&'Table'[Doc_Type]=87),[Requisition_Code])

vyangliumsft_0-1700531294466.png

If it doesn't meet your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

PhilipTreacy
Super User
Super User

Re: How to Get Your Question Answered Quickly - Page 5 - Microsoft Fabric Community 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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