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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
subho220
Helper I
Helper I

DAX issue

Helloss,

 Can anyone tell me the solution of the below mention Problem ? ->

 

I have a calculated column in my fact table, which is -

 

Test Request Age_New = DATEDIFF('FACT_Lab_Test_Request'[LIMS_Lab_Test_Request_Created_Date].[Date],NOW(),DAY)-if(ISBLANK(COUNTROWS(FILTER(HolidayList,AND(HolidayList[Date]>='FACT_Lab_Test_Request'[LIMS_Lab_Test_Request_Created_Date].[Date],HolidayList[Date]<=NOW())))),0,COUNTROWS(FILTER(HolidayList,AND(HolidayList[Date]>='FACT_Lab_Test_Request'[LIMS_Lab_Test_Request_Created_Date].[Date],HolidayList[Date]<=NOW()))))

 

Now I want to create the same column in my Orders dimension table. when i am trying to use the same calculation it gives me the below error -

subho220_0-1609265848234.png

also by applying Min or Max is not giving me correct result.

The relationship between Fact and Dim_order is Many to One and Single way.

 

What can be done in this case?

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

Hi @subho220 ,

 

Modify your measure as below:

Test Request Age_New = 
DATEDIFF (
    MAX('FACT_Lab_Test_Request'[Date]),
    NOW (),
    DAY
)
    - IF (
        ISBLANK (
            COUNTROWS (
                FILTER (
                    HolidayList,
                    AND (
                        HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
                        HolidayList[Date] <= NOW ()
                    )
                )
            )
        ),
        0,
        COUNTROWS (
            FILTER (
                HolidayList,
                AND (
                    HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
                    HolidayList[Date] <= NOW ()
                )
            )
        )
    )

 

And you will see:

 

v-kelly-msft_0-1609480644060.png

For the related .pbix file,pls see attached.

 

 

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @subho220 ,

 

Modify your measure as below:

Test Request Age_New = 
DATEDIFF (
    MAX('FACT_Lab_Test_Request'[Date]),
    NOW (),
    DAY
)
    - IF (
        ISBLANK (
            COUNTROWS (
                FILTER (
                    HolidayList,
                    AND (
                        HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
                        HolidayList[Date] <= NOW ()
                    )
                )
            )
        ),
        0,
        COUNTROWS (
            FILTER (
                HolidayList,
                AND (
                    HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
                    HolidayList[Date] <= NOW ()
                )
            )
        )
    )

 

And you will see:

 

v-kelly-msft_0-1609480644060.png

For the related .pbix file,pls see attached.

 

 

amitchandak
Super User
Super User

@subho220 , if you want to copy value from one table to another refer this video : https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
parry2k
Super User
Super User

@subho220 Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.