Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi Everyone,
I have below columns
1.Source, 2. This week Num of days without errors & Week of year column column. i want number of days without error.
In Below column for source CFDI all fives days in week-10, week-9, week-8 there was no error so number of days without error will be 15 but for FEX it has to be 9 because i have received error on day 1 of week 9 so it has to caliculate last 4 days of week9 (which doesn't have any error) and 5 days of week 10 (which doesn't have any error) how can i achive this
Solved! Go to Solution.
Hi @Anonymous ,
I updated my sample pbix file(see attachment), please check whether that is what you want.
|
Measure =
VAR _week =
CALCULATE (
MAX ( 'Table'[Week of Year] ),
FILTER (
'Table',
'Table'[Source] = SELECTEDVALUE ( 'Table'[Source] )
&&'Table'[Year]=SELECTEDVALUE('Table'[Year])
&& 'Table'[Days of week] < 5
)
)
VAR _days =
CALCULATE ( SUM ( 'Table'[Days of week] ) )
VAR _days1 =
CALCULATE (
SUM ( 'Table'[Days of week] ),
FILTER (
'Table',
'Table'[Source] = SELECTEDVALUE ( 'Table'[Source] )
&&'Table'[Year]=SELECTEDVALUE('Table'[Year])
&& 'Table'[Week of Year]
>= _week
)
)
RETURN
IF ( ISBLANK ( _week ), _days, _days1 )
|
|
Measure 2 = SUMX(VALUES('Table'[Source]),SUMX(VALUES('Table'[Year]),[Measure]))
|
Best Regards
Hi @Anonymous Thanks for the reply
I have date and week columns in my data. Days of Week column represents number of days without error in that week trying with ur measure but i am getting error i mean values i am geeting is 115 instead of 15
Hi @Anonymous ,
I just add date and week columns in my source data, it works well base on original measures... Could you please provide your sample pbix file with my measure(exclude sensitive data) and the formula if the field Days of Week is from measure or calculated column? By the way, whether include the data from different year? I want to make troubleshooting and find the cause to get the solution base on your scenario. Thank you.
Best Regards
@Anonymous Thansk for the soultion this worked for me. here i have only one year (2021) values. any idea if i have more that one year of data ...?
Hi @Anonymous ,
I updated my sample pbix file(see attachment), please check whether that is what you want.
|
Measure =
VAR _week =
CALCULATE (
MAX ( 'Table'[Week of Year] ),
FILTER (
'Table',
'Table'[Source] = SELECTEDVALUE ( 'Table'[Source] )
&&'Table'[Year]=SELECTEDVALUE('Table'[Year])
&& 'Table'[Days of week] < 5
)
)
VAR _days =
CALCULATE ( SUM ( 'Table'[Days of week] ) )
VAR _days1 =
CALCULATE (
SUM ( 'Table'[Days of week] ),
FILTER (
'Table',
'Table'[Source] = SELECTEDVALUE ( 'Table'[Source] )
&&'Table'[Year]=SELECTEDVALUE('Table'[Year])
&& 'Table'[Week of Year]
>= _week
)
)
RETURN
IF ( ISBLANK ( _week ), _days, _days1 )
|
|
Measure 2 = SUMX(VALUES('Table'[Source]),SUMX(VALUES('Table'[Year]),[Measure]))
|
Best Regards
@Anonymous Thank you this is working
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 66 | |
| 64 | |
| 31 | |
| 26 | |
| 26 |