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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
shahinnakhai
Frequent Visitor

undefinedFiscal period in Direct mode vs Import file

import reportimport report

 

direct reportdirect report

 

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

1 ACCEPTED SOLUTION

Hi @shahinnakhai ,

 

We can create a Hierarchy using following calculated colmun after we format the calculated column Fiscal Period as a Date:

 

 

1.jpg

 

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])

 

2.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-lid-msft
Community Support
Community Support

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"

 

4.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you for your help but still it came with number not name letter

Capture3.PNG

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
)

 

1.jpg

 

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,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Capture.PNG

Direct

Capture1.PNG

 

Thanks

Hi @shahinnakhai ,

 

We can create a Hierarchy using following calculated colmun after we format the calculated column Fiscal Period as a Date:

 

 

1.jpg

 

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])

 

2.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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