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

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

Reply
KL007
Regular Visitor

Creating a metric to show whether refresh has been pressed in the current month

Hi all,

 

I'm trying to create a visualisation to show the users of my BI Dashboard that the dataset has been refreshed this month. My idea was to use a table that contains the Column "Last Refresh" that updates it to the current date whenever it is refreshed. Then create a new table that checks wether the "Last Refresh" is within the current month, if it is then "Last Refresh Status" = 1, if not 0 (or something like that). 

For that I'm using the following DAX code, but the underlined values all contain errors (incorrect parameter type/cannot find):

Status Table =
ADDCOLUMNS(
    DimDate,
    "Last Refresh",
    RELATED('Monthly Refresh'[Monthly Refresh Month]),
    "Refresh Status Measure",
    IF([CurrentMonth] = 1 && [Last Refresh] >= STARTOFMONTH(TODAY()), "Green", "Red")
)

Any suggestions on how to improve this?

Thanks,


KL007
1 ACCEPTED SOLUTION
manvishah17
Solution Supplier
Solution Supplier

Hi  ,You can try this measure

Status Table =
ADDCOLUMNS(
DimDate,
"Last Refresh",
CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month])),
"CurrentMonth",
IF(
YEAR(CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month]))) = YEAR(TODAY()) &&
MONTH(CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month]))) = MONTH(TODAY()),
1,
0
),
"Refresh Status Measure",
IF(
[CurrentMonth] = 1 && [Last Refresh] >= STARTOFMONTH(TODAY()),
"Green",
"Red"
)
)

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
manvishah17
Solution Supplier
Solution Supplier

Hi  ,You can try this measure

Status Table =
ADDCOLUMNS(
DimDate,
"Last Refresh",
CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month])),
"CurrentMonth",
IF(
YEAR(CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month]))) = YEAR(TODAY()) &&
MONTH(CALCULATE(MAX('Monthly Refresh'[Monthly Refresh Month]))) = MONTH(TODAY()),
1,
0
),
"Refresh Status Measure",
IF(
[CurrentMonth] = 1 && [Last Refresh] >= STARTOFMONTH(TODAY()),
"Green",
"Red"
)
)

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

halfglassdarkly
Responsive Resident
Responsive Resident

I could be wrong but I suspect RELATED wouldn't work here as 'Status Table' isn't going to have any relationship to 'Monthly Refresh' until after the table is calculated and you create the relationship. You could try:

 

    "Last Refresh",
    Max('Monthly Refresh'[Monthly Refresh Month]),

Helpful resources

Announcements
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.

Top Solution Authors
Top Kudoed Authors