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
Hello,
thank you for the class. I want to create a report on the direct mode from SQL and calculate employment status of each month. I can easily do that on import mode with adding Fiscal Period on my data section or write
the M code (Fiscal Period = LEFT(LaborRoster[FISCPER],FIND("0",LaborRoster[FISCPER],1)+2) & "/" & RIGHT(LaborRoster[FISCPER],2)& "/01" )
but when it comes to Direct none of those work and it says Power BI doesn't support for direct mode. Also for M code there is something wrong for FIND function that give me error that I changed it to ( FIND("0", LaborRoster[FISCPER],1,0)+2) ) that is still wrong and doesn't show the name just date.
can you please help me on that?
Or give me an idea to make it like import file.
here is snapshots of different I get on the report
Thank you
Solved! Go to Solution.
Hi @shahinnakhai ,
We can create a Hierarchy using following calculated colmun after we format the calculated column Fiscal Period as a Date:
Fiscal Period Year = YEAR('LaborRoster'[Fiscal Period])
Fiscal Period Quartar = "Qtr " & QUARTER('LaborRoster'[Fiscal Period])
Fiscal Period Month =
SWITCH (
MONTH ( 'LaborRoster'[Fiscal Period] ),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "Sepember",
10, "October",
11, "November",
12, "December"
)
Fiscal Period Day = DAY('LaborRoster'[Fiscal Period])
Best regards,
Hi @shahinnakhai ,
If the FISCPER column is like 9999001/2019, we can create a calculated column using following dax to meet your requiremetn:
Fiscal Period =
RIGHT (
'LaborRoster'[FISCPER],
LEN ( [FISCPER] ) - FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 )
) & "/"
& RIGHT ( LEFT ( [FISCPER], FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 ) - 1 ), 2 ) & "/01"
Best regards,
thank you for your help but still it came with number not name letter
Hi @shahinnakhai ,
Please try to create the following calculated column and format it as the "Date" and "MMMM d":
Fiscal Period Date =
DATE (
RIGHT ( 'LaborRoster'[FISCPER], LEN ( [FISCPER] ) - FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 )),
RIGHT ( LEFT ( [FISCPER], FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 ) - 1 ), 2 ),
1
)
If it does not work, please use the following version:
Fiscal Period Date =
DATE (
VALUE(RIGHT ( 'LaborRoster'[FISCPER], LEN ( [FISCPER] ) - FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 ))),
VALUE(RIGHT ( LEFT ( [FISCPER], FIND ( "/", 'LaborRoster'[FISCPER], 1, 0 ) - 1 ), 2 )),
1
)
Sorry for that we can not share the sample pbix file because it is using DirectQuery Mode.
Best regards,
Unfortunately didn't work. It is going to name it as Jan and Feb but the issue is Power BI doesn't take Fiscal period as date with hierarchy of date with year, quarter, month and day. and Hierarchy doesn't get populated.
import
Direct
Thanks
Hi @shahinnakhai ,
We can create a Hierarchy using following calculated colmun after we format the calculated column Fiscal Period as a Date:
Fiscal Period Year = YEAR('LaborRoster'[Fiscal Period])
Fiscal Period Quartar = "Qtr " & QUARTER('LaborRoster'[Fiscal Period])
Fiscal Period Month =
SWITCH (
MONTH ( 'LaborRoster'[Fiscal Period] ),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "Sepember",
10, "October",
11, "November",
12, "December"
)
Fiscal Period Day = DAY('LaborRoster'[Fiscal Period])
Best regards,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |