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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Malsha
Helper I
Helper I

matrix visual columns issue

Hi,
I have created a matrix as below.

Malsha_0-1698148605240.png


I'm using the below measure to get the values for selected dates.

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

return
cal

I need to show '0.00' for the blank values which means SUM('timesheet_data'[Hours Worked]) = 0. for that I modified the above measure as below. But it gives 0.00 for all the values without giving correct answers. what's the solution for this and what's the error in my measure.
Any help most appreciated. Many thanks.
Total Worked Hours =
var cal =
CALCULATE(
    SUM('timesheet_data'[Hours Worked]),
    'timesheet_data'[Timesheet Job Role Name] IN {"Morning Cleaning", "Janitors", "Window Cleaner", "Duty & Morning", "Supervisor"},
    'timesheet_data'[duration] <> "S",
    'timesheet_data'[duration] <> "H"
)

var ans = COALESCE(cal, 0.00)

return
ans
Malsha_1-1698149103750.png

 



3 REPLIES 3
AmiraBedh
Resident Rockstar
Resident Rockstar

Can you try the following : 

 

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

return
IF(ISBLANK(cal), 0.00, cal)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi AmiraBedh,
I tried that measure but it also gives the 0.00 as value for all the dates.

Can you please provide some of your dataset ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.