Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All,
I'm stuck on a calculated measure I'm trying to create and would need help here.
Solved! Go to Solution.
@v-csrikanth Thanks for trying but I managed to achieve the desired result myself using the below approach.
The measure you shared wont work because of the flag condition. Suppose I want Month1 last day's data to be seen when I'm using the flah "Is_Last_Day_of_Fiscal_Quarter" but since that day doesn't fall under the last fiscal month of quarter the measure you tried wont work.
I created a seperate flag table using the below DAX and altered my measure to use this flag table.
Let me know in case any further help/clarification is needed
This way I'm able to achieve the desired result.
We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
@v-csrikanth Thanks for trying but I managed to achieve the desired result myself using the below approach.
The measure you shared wont work because of the flag condition. Suppose I want Month1 last day's data to be seen when I'm using the flah "Is_Last_Day_of_Fiscal_Quarter" but since that day doesn't fall under the last fiscal month of quarter the measure you tried wont work.
I created a seperate flag table using the below DAX and altered my measure to use this flag table.
Let me know in case any further help/clarification is needed
This way I'm able to achieve the desired result.
HI @Himanshu_1306
Based on the attached pbix file please go throught and try the below measure that meets your rquirements.
The function ALL and ALL Selected, override the filters thats why the existing measure wouldnt work.
You can use a combination of Remove filters and Keep filters respecting existing filters (like SVP/RVP).
Try this measure:
Month1_CW_MTD_New =
VAR IsLastDayOfQuarter = SELECTEDVALUE(VW_D_DATE[IS_LAST_FISCAL_DAY_OF_QUARTER], FALSE)
VAR IsLastDayOfMonth = SELECTEDVALUE(VW_D_DATE[IS_LAST_DAY_OF_MONTH], FALSE)
VAR CurrentMonth = SELECTEDVALUE(VW_F_PIPELINE_HISTORY[Month])
VAR SelectedQuarter = SELECTEDVALUE(VW_F_PIPELINE_HISTORY[FISCAL_YEAR_QUARTER])
VAR IsSpecialDay =
IsLastDayOfQuarter ||
(IsLastDayOfMonth && CurrentMonth = 1)
VAR Month1EndValue =
CALCULATE(
SUM(VW_F_PIPELINE_HISTORY[CW_MTD]),
REMOVEFILTERS(VW_F_PIPELINE_HISTORY[is_last_day_of_fiscal_month]),
FILTER(
ALL(VW_D_DATE),
VW_D_DATE[is_last_day_of_fiscal_month] = TRUE()
),
KEEPFILTERS(
VW_F_PIPELINE_HISTORY[Month] = 1 &&
VW_F_PIPELINE_HISTORY[FISCAL_YEAR_QUARTER] = SelectedQuarter
)
)
VAR DailyValue =
CALCULATE(
SUM(VW_F_PIPELINE_HISTORY[CW_MTD]),
KEEPFILTERS(
VW_F_PIPELINE_HISTORY[Month] = 1
)
)
RETURN
IF(
IsSpecialDay,
Month1EndValue,
DailyValue
)
If the issue has been resolved, can you mark the post as resolved. If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!
Best Regards,
Community Support Team _ C Srikanth.
Hi @Himanshu_1306 please try this
Month1_CW_MTD_Newf =
VAR IsLastDayOfQuarter = SELECTEDVALUE(VW_D_DATE[IS_LAST_FISCAL_DAY_OF_QUARTER], FALSE)
VAR IsLastDayOfMonth = SELECTEDVALUE(VW_D_DATE[IS_LAST_DAY_OF_MONTH], FALSE)
VAR CurrentMonth = SELECTEDVALUE(VW_F_PIPELINE_HISTORY[Month])
VAR SelectedQuarter = SELECTEDVALUE(VW_F_PIPELINE_HISTORY[FISCAL_YEAR_QUARTER])
VAR IsSpecialDay =
IsLastDayOfQuarter ||
(IsLastDayOfMonth && CurrentMonth = 1)
VAR Month1EndValue =
CALCULATE(
SUM(VW_F_PIPELINE_HISTORY[CW_MTD]),
KEEPFILTERS(VW_F_PIPELINE_HISTORY),
FILTER(
VW_F_PIPELINE_HISTORY,
VW_F_PIPELINE_HISTORY[Month] = CurrentMonth &&
VW_F_PIPELINE_HISTORY[FISCAL_YEAR_QUARTER] = SelectedQuarter &&
VW_F_PIPELINE_HISTORY[is_last_day_of_fiscal_month] = TRUE()
)
)
VAR DailyValue =
CALCULATE(
SUM(VW_F_PIPELINE_HISTORY[CW_MTD]),
FILTER(
VW_F_PIPELINE_HISTORY,
VW_F_PIPELINE_HISTORY[Month] = 1
)
)
RETURN
IF(
IsSpecialDay,
Month1EndValue,
DailyValue
)
I've tried using KEEPFILTERS as a function. If I use the above measure I'm getting numbers for last of the month 1and month 2 when I use is_last_day_fiscal_quarter = TRUE but the numbers I'm getting is wrong. Ideally I should get $3.10M in Month 1 and $8.07M in Month 2 as values when I select is_last_day_fiscal_quarter = True.
Using Fiscal_Quarter Flag ( Wrong Numbers):
Correct Numbers:
Let me know if you find any solution. I'm still stuck on this.
I've attached the link to the PBIX file as well.
ok
Need to create dynamic logic for each fiscal month (Month 1 and 2) that:
On Daily View (No Flags):
Show the daily CW_MTD value for each date within the respective fiscal month.
When a Flag is Used (Month-End or Quarter-End):
Show the final CW_MTD value of that fiscal month, only if:
The row belongs to that month (Month 1 or 2), and
The flag (IS_LAST_DAY_OF_MONTH or IS_LAST_FISCAL_DAY_OF_QUARTER) is set to TRUE.
Able to filter data on any cuts in the dataset.
Note: Month 3 uses a simple calculation and is giving correct value and filtering is also working fine. Need to create seperate measures for Month 1 and Month 2