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

View all the Fabric Data Days sessions on demand. View schedule

Reply
jj1
Helper II
Helper II

Dax Sales by Bus Day

 
1 ACCEPTED SOLUTION
v-dineshya
Community Support
Community Support

Hi @jj1 ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

Could you please share PBIX file with sample data?, it must be data type error or data modeling error .This will help us better understand your issue and guide you toward a solution.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

View solution in original post

19 REPLIES 19
techies
Super User
Super User

Hi @jj1 please check this

 

AB.png

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

ok

v-dineshya
Community Support
Community Support

Hi @jj1 ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

Could you please share PBIX file with sample data?, it must be data type error or data modeling error .This will help us better understand your issue and guide you toward a solution.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Hi @jj1 ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

Could you please share PBIX file with sample data?, it must be data type error or data modeling error .This will help us better understand your issue and guide you toward a solution.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Hi @jj1 ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

Could you please share PBIX file with sample data?, it must be data type error or data modeling error .This will help us better understand your issue and guide you toward a solution.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Hi @jj1 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.In case we do not receive a response, we shall proceed to close this thread. For any further discussions or queries, please initiate a new thread in the Microsoft Fabric Community Forum, where we will be glad to assist you.

Thank you.

Anonymous
Not applicable

Hi @jj1,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

Please find below DAX code.

SalesByWorkigDays = 
CALCULATE(
    SUM('Revenue table'[Sales]),
    'Calc Table'[ISWORKINGDay] IN {1, 2, 3, 4, 5}
)

 

I took sample dataset, please refer the snap

vvpabbu_1-1743166245722.png

 

Please find the result set based on sample dataset

vvpabbu_0-1743166224462.jpeg

 

As you mentioned, Table 1 (Calc Table) and Table 2 (Revenue Table) are the two data sources. Based on my case, there is no relationship between the two tables, which led to unexpected results.

 

If you have valid relationship between tables the results will be as expected 

 

Thanks

Vinay Pabbu

 

techies
Super User
Super User

Hi @jj1 hope this is as required

 

Total Sales Business Days =
CALCULATE(
    SUM('Sales'[Sales]),
    'date'[Week Value] <= 5
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

ok

Hi @jj1 create calculated column in date table as this

 

IsBusinessDay =
VAR Weekend = WEEKDAY('Date'[Date], 2) >= 6

RETURN
    IF(Weekend, FALSE(), TRUE())
 
 
and then create measure avg business day
 
Avg business days = VAR BusinessDayCount =
    CALCULATE(
        DISTINCTCOUNT('date'[Date]),
        'date'[IsBusinessDay] = TRUE()
    )

VAR TotalSalesBusinessDays =
    CALCULATE(
        SUM('Sales'[Sales]),
        'date'[IsBusinessDay] = TRUE()
    )

RETURN
    DIVIDE(TotalSalesBusinessDays, BusinessDayCount, 0)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

ok

try adding like this --

Revenue Bus Day =
VAR BusinessDayCount =
CALCULATE(
DISTINCTCOUNT('Date Table'[date]),
'Date Table'[Bus Day] = TRUE()
)

 

VAR TotalSales =
SUM(JJProduct[Grand_Total])
- SUM(JJProduct[Discount_Total])
- SUM(JJProduct[Sales_Tax])

VAR TotalSalesBusinessDays =
CALCULATE(
TotalSales,
'Date Table'[Bus Day] = TRUE()
)

RETURN
DIVIDE(TotalSalesBusinessDays, BusinessDayCount, 0)

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

same error even with that new approach you recommended

ok

 measure provided is fine but now an error with BI Dax visual

jj1_3-1743439642363.png

 

Defining

yes, this is the one measure for the average business day 

 

Avg business days = 
VAR BusinessDayCount =
    CALCULATE(
        DISTINCTCOUNT('date'[Date]),
        'date'[IsBusinessDay] = TRUE()
    )

 

VAR TotalSalesBusinessDays =
    CALCULATE(
        SUM('Sales'[Sales]),
        'date'[IsBusinessDay] = TRUE()
    )

 

RETURN
    DIVIDE(TotalSalesBusinessDaysBusinessDayCount0)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

Thanks Let me try this-

ok

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.