Forum Discussion
what if parameter
Hello i have a question about the what if parameter.
I would like to create a colum base on this dax formula:
Kolom = if(Parameter[Waarde van Parameter] = 1;Boek_ink_verk_openstaand[factuur datum];Boek_ink_verk_openstaand[factuur datum])
So if the parameter value is selected as '1' it should return Boek_ink_verk_openstaand[factuur datum] else
Boek_ink_verk_openstaand[factuur datum].
But it doensn't work!
Thanx
6 Replies
- parry2kSuper User
What if parameter is a measure and you have to add a measure not column.
- Eric_ZhangMicrosoft Employee
What-if parameter actually works in a slicer, and the slicer doesn't affect any calculated column/table, see why.
Just follow the suggestion in above post, create a measure instead of calculated column.
- ArnohHelper III
Hello,
I am looking for a way to create a parameter where from i can select one option to make a measure whitch shows a date based on te selected parameter.
I try to explain.
The parameter should have the following options:
- date based on invoice date
- date based on pay date
- date based on expected pay date
I would like to have a calculated collum or a measure witch showes the date based on the selection.
Is this possible?
Thanx
- parry2kSuper User
add new table called "Date Slicer" with 3 records:
Id Choose Date
1 date based on invoice date
2 date based on pay date
3 date based on expected pay date
Add "Choose Date" as slicer
Add a measure
Date based on slicer = var selectedId = SELECTEDVALUE('Date Slicer'[Id], BLANK()) return if(selectedId = BLANK(), BLANK(), if(selectedId = 1, FIRSTDATE(Table[InvoiceDate]), if(Selectedid = 3, FIRSTDATE(Table[PayDate]), FIRSTDATE(Table[ExpectedPayDate]) ) ) )"Date Based on Slicer" measure will show the date based on option selected in Slicer, if more than one option selected or no option selected it will return blank and that you can change in your measure (red) if you want different behaviour.