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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kolli002
New Member

I have a issue with DAX

Hello Team,

I hope everyone is doing well!

I am facing an issue in my report.

I am expecting the output as below:

  • Employee Name: Nellaiappan Gomathinayagam

  • Week: 4–10 → 2 Days, and 11–17 → 3 Days (Month: Aug 2025)

But currently, I am getting the output incorrectly:

  • Under week 4–10 → only 1 day is showing

  • Week 11–17 is missing completely

I have used the calculation shown below.
Could you please assist me in resolving this issue?


Date Table calculation:

DateTable =
ADDCOLUMNS (
    CALENDAR ( MIN ( Attendance[date] ), MAX ( Attendance[date] ) ),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMM yyyy" ),
    "Week Start", [Date] - WEEKDAY ( [Date], 2 ) + 1,   -- Monday
    "Week End", ([Date] - WEEKDAY ( [Date], 2 ) + 1) + 6,  -- Week Start + 6
    "Week Number", WEEKNUM ( [Date], 2 ),               -- Mon–Sun
    "YearWeek",
        YEAR ( [Date] - WEEKDAY ( [Date], 2 ) + 1 ) * 100
        + WEEKNUM ( [Date] - WEEKDAY ( [Date], 2 ) + 1, 2 )
)

Week Label: 
VAR StartOfWeek = 'DateTable'[Date] - WEEKDAY ( 'DateTable'[Date], 2 ) + 1
VAR EndOfWeek   = StartOfWeek + 6
RETURN
    FORMAT ( StartOfWeek, "DD" ) & " - "
    & FORMAT ( EndOfWeek, "DD" ) & ", "
    & FORMAT ( EndOfWeek, "MMM" )

Days Present per Week =
CALCULATE (
    DISTINCTCOUNT ( Attendance[Date] ),
    KEEPFILTERS ( VALUES ( DateTable[Date] ) )
)
Source data screen shot is below:
kolli002_1-1756096942130.png

Report output:

kolli002_2-1756097582185.png

Relation ship in Model:

kolli002_3-1756097702512.png

 



 

1 ACCEPTED SOLUTION
v-sdhruv
Community Support
Community Support

Hi @kolli002 ,

If you are still facing any issue, kindly provide a sample data so that we can assist you better.
Please exclude sensitive information while providing sample data. Here is a helpful link which might help you provide data-

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Thank you for reaching out on Microsoft Community Forum

View solution in original post

5 REPLIES 5
v-sdhruv
Community Support
Community Support

Hi @kolli002 ,
I hope the explaination provided, has addressed your query.
Since we didnt hear back, we would be closing this thread.
If you need any assistance, feel free to reach out.

Thank you

v-sdhruv
Community Support
Community Support

Hi @kolli002 ,


Just wanted to check if you got a chance to review the suggestion provided?
If you need any assistance, please feel free to reach out so that we can assist you better.

Thank you for reaching out on Microsoft Community Forum

tillwickl
New Member

It would appear that you've created your "Days Present per Week" as a calculated column? 

 

I don't think you need to change the syntax of your DAX. If you want it to change for each employee that you've selected create it as a measure instead. 

v-sdhruv
Community Support
Community Support

Hi @kolli002 ,

If you are still facing any issue, kindly provide a sample data so that we can assist you better.
Please exclude sensitive information while providing sample data. Here is a helpful link which might help you provide data-

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Thank you for reaching out on Microsoft Community Forum

FBergamaschi
Solution Sage
Solution Sage

Hi @kolli002,

without usable data, I can only suggest to use a simpler code

Days Present per Week =

DISTINCTCOUNT ( Attendance[Date] )

 

Does that work?

 

If not, 

can you please share the pbix via some cloud service? Or in alternative can you please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.