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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dgpte
Frequent Visitor

row context conditional

Hello!
I need to create a measure:
I have 'Table1'[Type]. Has values " 1,2 and 3".
I want each value "1" to create a variable "x". This variable "x" will end 10 days afther it is created. 
The creation date is 'Table1'[Date].
 
So, I  tried to create "x", but the conditional function doesn´t work whit the row context. I tried again:
calculate( count('Table1'[Type]), 'Table1'[Type]= "1") but i dont know how to create an x of each value 1.
I am stuck.
 
thank you!!
4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @Dgpte 

 

Is this what you want?

Measure = 
var vDate = IF(SELECTEDVALUE(Table1[Type])="1",SELECTEDVALUE(Table1[Date])+10,BLANK())
return
vDate

21123101.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

smpa01
Super User
Super User

@Dgpte  please provide sample data

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
ValtteriN
Super User
Super User

Hi,

I am not sure if I understood correctly, but basically you want to calculate your values if their "type" is 1 and they have been created within the past 10 days?

Test data:
Excpected result is 2

ValtteriN_0-1640724780576.png

Dax:

TypeCount =
CALCULATE(COUNTROWS(TypeCount),TypeCount[Type]=1,DATESBETWEEN(TypeCount[Date],TODAY()-10,TODAY()))

End result:
ValtteriN_1-1640724942949.png


I am not sure if I understood what you are trying to do, but I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




bcdobbs
Super User
Super User

Hi,
Are you able to provide a demo pbix file and an idea of the final result you're after.

 

From your description I think you might want a calculated column rather than a measure. The measure you give doesn't have an iterator in it so has no concept of a row. Hoping can help more with a demo file!



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors