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.
Hi
I am new to DAX , can you please help to write down an IF statement that described by the below :
Using IF statements to decide if the year is 2022, month is 36 else 48
Thanks
Solved! Go to Solution.
Hi @HishamAT
Tis is not the end result right? But I can give you some ideas based on your input.
This i my base data with the table called BaseTable:
1) Example with calculated column
Calculated Column Example = IF([Year]=2022,36,48)
Now with a measure:
Measure Example =
IF(MAX(BaseTable[Year])=2022,36,48)
Is this what you are looking for? If not please provide an end-2-end problem startement from data source to calculation to visual.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
Hi @HishamAT
Tis is not the end result right? But I can give you some ideas based on your input.
This i my base data with the table called BaseTable:
1) Example with calculated column
Calculated Column Example = IF([Year]=2022,36,48)
Now with a measure:
Measure Example =
IF(MAX(BaseTable[Year])=2022,36,48)
Is this what you are looking for? If not please provide an end-2-end problem startement from data source to calculation to visual.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
Hi @HishamAT
Can you please provide more context, e.g. the data model, sample data as well as explanation what you want to have as an output (Do you want the result to be shown in a calculated column? in a visual? what kind of visual?)
if it is a calculate column then it would be IF([year] = 2022,36,48)
But I have the feeling that this will not help you in the end.
Best regards
Michael
I have a table of Date, contains a year column:
Year | Month |
2018 | 2 |
2019 | 3 |
2020 | 4 |
2021 | 5 |
2022 | 6 |
and i need return a measure field that if have the value of the 2022 = 36
else a measure field that have the value of the 2023 = 48
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
98 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |