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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Selded
Helper III
Helper III

Dax measures , multiple if's

 

1. I need a dax measure that will return the items in the blue based on the duration and first half, if first half is PR, the measure should return 12, otherwise, it should return what is in first half column. In this measure, day 6 and 7 should return blank.

2. for the second measure, i want a dax that will count the number of days John Doe is at work contineously, and  for day 6 and 7 return 12. It should aonly return the 12 for day 6 and 7

 

Selded_1-1754478330203.png

 expected output

 

Selded_2-1754478998648.png

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Selded Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello Greg, 

 

1. Sample data as shown in table below

2. Calculated column,  if firsthalf=PR, return 12, otherwise return first half 

3. Calculated measure to return same as calculated column.

4.  i want a dax that will count the number of days John Doe is at work contineously, and  for day 6 and 7 return 12. It should aonly return the 12 for day 6 and 7

 

Below is the data sample

UserIDPDateUserNameStatusWorkingShiftShift DurationCalculated colum
TT2S02717/09/2024 0:00JESSY MATTPRRD1212
TT2S02718/09/2024 0:00JESSY MATTALRD0RD0
TT2S02719/09/2024 0:00JESSY MATTPRDS0AL
TT2S02820/09/2024 0:00JESSY MATTMLDS0ML
TT2S02618/09/2024 0:00LUKE KATEMLNS0ML
TT2S02819/09/2024 0:00ASHLEY MOOREMLNS0ML
TT2S02920/09/2024 0:00MARK COOKMLNS0ML
TT2S02817/09/2024 0:00JOHN DOEPRDS1212
TT2S02818/09/2024 0:00JOHN DOEPRDS1212
TT2S02819/09/2024 0:00JOHN DOEPRDS1212
TT2S02820/09/2024 0:00JOHN DOEPRDS1212
TT2S02821/09/2024 0:00JOHN DOEPRNS1212
TT2S02822/09/2024 0:00JOHN DOEPRNS1212
TT2S02823/09/2024 0:00JOHN DOEPRNS1212
TT2S02824/09/2024 0:00JOHN DOEPRNS1212
TT2S02825/09/2024 0:00JOHN DOERDRD0RD
TT2S02826/09/2024 0:00JOHN DOERDRD0RD
TT2S02827/09/2024 0:00JOHN DOERDRD0RD
TT2S02828/09/2024 0:00JOHN DOERDRD0RD
TT2S02829/09/2024 0:00JOHN DOEPRDS1212
TT2S02830/09/2024 0:00JOHN DOEALDS0AL
TT2S02801/10/2024 0:00JOHN DOEALDS0AL
TT2S02802/10/2024 0:00JOHN DOEALDS0AL
TT2S02803/10/2024 0:00JOHN DOEALDS0AL
      12

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.