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

Join 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

Reply
Malsha
Helper I
Helper I

Measures Issue

Hi everyone,
I have created these 3 measures for my power bi report and those 3 measures display as columns in the report..

Malsha_0-1693562939827.png


1.   column Total Worked:

Total Worked =
CALCULATE(
    SUM('v_pbi_ccs_timesheet_data_v1'[Hours Worked]),
    'v_pbi_ccs_timesheet_data_v1'[Timesheet Job Role Name] IN {"Morning Cleaning", "Janitors", "Window Cleaner", "Duty & Morning", "Supervisor"},
    'v_pbi_ccs_timesheet_data_v1'[duration] <> "S",
    'v_pbi_ccs_timesheet_data_v1'[duration] <> "H"
)

2. column Allocated: 
worked hours for selected period =
var start_date = MIN(v_pbi_ccs_timesheet_data_v1[timesheet_date])
var end_date = MAX(v_pbi_ccs_timesheet_data_v1[timesheet_date])
var ans = DATEDIFF(start_date,end_date,DAY) + 1
var hours = SUM(v_pbi_ccs_subunit_v1[allocated_hours])
return
(ans * hours)/7

3. column Difference:
difference = [Total Worked] - [worked hours for selected period]

If total worked column has blank values, I want to show the value as "N/A" in the difference column. How can I do this?

5 REPLIES 5
BITomS
Solution Supplier
Solution Supplier

Hi @Malsha 

 

For your 3rd measure, I think you can use an IF expression with ISBLANK:

 

Measure = IF(ISBLANK([Total Worked]),"N/A",[Total Worked] - [worked hours for selected period])

 

Hope this helps.

Hi, This works but it gives duplicated records.

Ritaf1983
Super User
Super User

Hi @Malsha 

difference =if(isblank( [Total Worked]),"N/A", [Total Worked] - [worked hours for selected period])

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi, This is working but it gives duplicated records. what's the reason for that.

Hi @Malsha 
i need to see a pbix to understand it

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.