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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
ashmitp869
Post Patron
Post Patron

paginated Report Query Editor help required.

Hi All,

 

I have requriement in Paginated Report where I am using 4 tables to join 

PayItem, Projects, Date and BilledRevenueDetail.

 

My Dax Query Editor giving me this below error. please help.

ashmitp869_0-1722215461636.png

My Code

 

EVALUATE
VAR PayItemProjects =
    ADDCOLUMNS(
        SUMMARIZE(
            PayItem,
            PayItem[PayItemId],
            PayItem[PayItemNumber],
            PayItem[Description],
            PayItem[UnitofMeasureName],
            PayItem[ForecastTakeOffQuantity],
            PayItem[ForecastUnitRevenue],
            PayItem[Project_id],
            "SumForecastFinalRevenue", SUM(PayItem[ForecastFinalRevenue])
        ),
        "ProjectName", LOOKUPVALUE(Projects[ProjectName], Projects[Project_id], PayItem[Project_id])
    )

VAR BilledPayItem =
    ADDCOLUMNS(
        SUMMARIZE(
            BilledRevenueDetail,
            BilledRevenueDetail[PayItemId],
            BilledRevenueDetail[BilledDate]
        ),
        "SumBilledRevenue", CALCULATE(SUM(BilledRevenueDetail[BilledRevenue])),
        "BilledQuantity", CALCULATE(SUM(BilledRevenueDetail[BilledQuantity]))
    )

VAR DateInfo =
    SELECTCOLUMNS(
        Date,
        "BilledDate", Date[Date],
        "Year", Date[Year],
        "MonthName", Date[MonthName]
    )

VAR Result =
    NATURALINNERJOIN(
        PayItemProjects,
        BilledPayItem
    )

VAR FinalResult =
    NATURALINNERJOIN(
        Result,
        DateInfo
    )

RETURN
    SELECTCOLUMNS(
        FinalResult,
        "PayItemId", [PayItemId],
        "Project_id", [Project_id],
        "ProjectName", [ProjectName],
        "PayItemNumber", [PayItemNumber],
        "Description", [Description],
        "UnitofMeasureName", [UnitofMeasureName],
        "ForecastTakeOffQuantity", [ForecastTakeOffQuantity],
        "ForecastUnitRevenue", [ForecastUnitRevenue],
        "SumForecastFinalRevenue", [SumForecastFinalRevenue],
        "BilledQuantity", [BilledQuantity],
        "SumBilledRevenue", [SumBilledRevenue],
        "BilledDate", [BilledDate],
        "Year", [Year],
        "MonthName", [MonthName]
    )

 

 

 

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

Date is a key word in DAX. If you have a table called Date you need to quote it with single quotes.

eg 'Date'[Date] instead of just Date[Date]

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

Date is a key word in DAX. If you have a table called Date you need to quote it with single quotes.

eg 'Date'[Date] instead of just Date[Date]

Helpful resources

Announcements
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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