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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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 ()
)

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.
Anonymous
Not applicable

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 ()
)
Anonymous
Not applicable

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 )
)
Anonymous
Not applicable

Hi Nick

 

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

Result.PNG

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors