cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Route217 Member
Member

Addcolumns DAX formula error

Hi Experts

 

cannot see the wood for the trees, i just want to rank my values based on the data column.

Table 2 = ADDCOLUMNS(ADDCOLUMNS(FILTER(CALENDAR(MIN(PMS_FINANCIAL_PDS[FISCAL_MON_START_DT]),MAX(PMS_FINANCIAL_PDS[FISCAL_MON_END_DT])),DAY([Date]) =1),
        "CountComplaints", CALCULATE(COUNTROWS(PMS_COMPLAINT),
            FILTER(PMS_COMPLAINT,PMS_COMPLAINT[Fiscal_Mnth_Start_Date].[Year] = YEAR(EARLIER([Date]))
                && PMS_COMPLAINT[Fiscal_Mnth_Start_Date].[MonthNo] = MONTH(EARLIER([Date]))))+0),"__Index",RANKX(PMS_COMPLAINT,PMS_COMPLAINT[Fiscal_Mnth_Start_Date],,,Dense))
1 ACCEPTED SOLUTION

Accepted Solutions
Route217 Member
Member

Re: Addcolumns DAX formula error

Hi Microsoft Team i have managed to solve said solution

 

VAR Mytable1 = FILTER(ADDCOLUMNS(VALUES(PMS_FINANCIAL_PDS[Month Start]),"CountComplaints", CALCULATE(COUNTROWS(PMS_COMPLAINT)),"__Index",RANKX(PMS_FINANCIAL_PDS,PMS_FINANCIAL_PDS[Month Start],,,Dense )),[Month Start] <> BLANK ()
)
4 REPLIES 4
Super User
Super User

Re: Addcolumns DAX formula error

can you upload a sample with your expect outcome?  I'm pretty sure at least some of the error has to do with 

Table 2 =
ADDCOLUMNS (
    ADDCOLUMNS (
        FILTER (
            CALENDAR (
                MIN ( PMS_FINANCIAL_PDS[FISCAL_MON_START_DT] ),
                MAX ( PMS_FINANCIAL_PDS[FISCAL_MON_END_DT] )
            ),
            DAY ( [Date] ) = 1
        ),
        "CountComplaints", CALCULATE (
            COUNTROWS ( PMS_COMPLAINT ),
            FILTER (
                PMS_COMPLAINT,
                PMS_COMPLAINT[Fiscal_Mnth_Start_Date].[Year] = YEAR ( EARLIER ( [Date] ) )
                    && PMS_COMPLAINT[Fiscal_Mnth_Start_Date].[MonthNo] = MONTH ( EARLIER ( [Date] ) )
            )
        ) + 0
    ),
    "__Index", RANKX ( PMS_COMPLAINT, PMS_COMPLAINT[Fiscal_Mnth_Start_Date],,, DENSE )
)
Route217 Member
Member

Re: Addcolumns DAX formula error

Hi Nick

 

The expected end results need to be... see image

Result.PNG

Community Support Team
Community Support Team

Re: Addcolumns DAX formula error

Hi @Route217 ,

 

Do you have some sample data or preferably a sample pbix file?

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Route217 Member
Member

Re: Addcolumns DAX formula error

Hi Microsoft Team i have managed to solve said solution

 

VAR Mytable1 = FILTER(ADDCOLUMNS(VALUES(PMS_FINANCIAL_PDS[Month Start]),"CountComplaints", CALCULATE(COUNTROWS(PMS_COMPLAINT)),"__Index",RANKX(PMS_FINANCIAL_PDS,PMS_FINANCIAL_PDS[Month Start],,,Dense )),[Month Start] <> BLANK ()
)

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 6 members 2,639 guests
Please welcome our newest community members: