March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I want to create variable in Powerbi, below is the sap bo formula.
Please help me.
Fisical_year_filter= CASE WHEN (substr(current_date,6,2)) IN ( '01','02','03') THEN (substr(current_date,1,4)-1) ELSE (substr(current_date,1,4)) END
Solved! Go to Solution.
Hi @Harish85 ,
What is the result of your current formula? Also, what are your expected results? I was hoping you could provide an example.
In general, in DAX we use the If as the judgment statement and the MID to extract the substring. You can try below formula firstly.
Measure = IF(MID(MAX('Table'[DATE]),6,2) IN {"01","02","03"}, MID(MAX('Table'[DATE]),1,4)-1,MID(MAX('Table'[DATE]),1,4))
Best regards,
Mengmeng Li
Hi @Harish85 ,
What is the result of your current formula? Also, what are your expected results? I was hoping you could provide an example.
In general, in DAX we use the If as the judgment statement and the MID to extract the substring. You can try below formula firstly.
Measure = IF(MID(MAX('Table'[DATE]),6,2) IN {"01","02","03"}, MID(MAX('Table'[DATE]),1,4)-1,MID(MAX('Table'[DATE]),1,4))
Best regards,
Mengmeng Li
I you want to write that in Dax try something like this
Fisical_year_filter= if(substr(current_date,6,2) in {01,02,03}, date(year(today),month(1), day(1))-1, date(year(today),month(1), day(1))
I am not sure I got everything right, but a good place to start would be to look of power BI
If function
In function
datediff function.
I think that would get you in the direction of a good solution.
when I am trying to create above given formula substring is not coming up, can you help me in that.
Is sustring a value in a table? If so:
First write selectedvalue( and then write substring.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
105 | |
99 | |
64 | |
54 |