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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DataFunness
Helper I
Helper I

how to get 1 column/value from another table via DAX

I have a fact table with invoice information (Invoice Perspective) and a Working Days table that provided the current business day (workingday column) and the total number of working days in a month (workingdays2).  They are linked by a “year-month” column.  I am trying to pull in the current working day and total working days into measures in Invoice Perspective.  I am not sure on the DAX to use.  The measure below is now getting an error that says, “the expression refers to multiple columns. multiple columns cannot be converted to a scalar value” about bringing back an entire table.  There is only 1 row in the working days table for each year and month combination.  How do I link to that one row without errors? 

 

thank you in advance,

Matt

 

working day of month =

    VAR selectedYear = 'Calendar'[SelectedYear]

    VAR selectedMonth = 'Calendar'[SelectedMonth]

    RETURN CALCULATE(sumx('Working Days',

            FILTER('Working Days',

            'Working Days'[Month]=selectedMonth && 'Working Days'[Year]=selectedYear)))

 

DataFunness_0-1694789197506.png

 

Working Days table:

DataFunness_1-1694789210493.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DataFunness ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_2-1695092240758.png

vtangjiemsft_0-1695092191777.png

(2) We can create a calculated column.

Column = CALCULATE(SUM('Working Days'[Working day]),FILTER('Working Days','Working Days'[Year-Month]=EARLIER('Invoice'[Year-Month])))

(3) Then the result is as follows.

vtangjiemsft_1-1695092225516.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

3 REPLIES 3
Anonymous
Not applicable

Hi @DataFunness ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_2-1695092240758.png

vtangjiemsft_0-1695092191777.png

(2) We can create a calculated column.

Column = CALCULATE(SUM('Working Days'[Working day]),FILTER('Working Days','Working Days'[Year-Month]=EARLIER('Invoice'[Year-Month])))

(3) Then the result is as follows.

vtangjiemsft_1-1695092225516.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

DataFunness
Helper I
Helper I

@Pady Thank you for the message.  This is using NETWORKDAYS.  I am not looking to count days.  The table I am joining too has a count of days.  How do I use dax to "query" to get to the right value in my Working Days table?

Pady
Helper II
Helper II

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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