Forum Discussion

jaryszek's avatar
jaryszek
Super User
1 year ago
Solved

How to selectively choose days based on folder structure within parameters?

I have folders structurized like that:
AmortizedCosts\
Daily\
2025\
04\
Fct_EA_AmortizedCosts_04.01.2025.csv
Fct_EA_AmortizedCosts_04.02.2025.csv
05\
...
Monthly\
2025\
Fct_EA_AmortizedCosts_04.2025.csv
Fct_EA_AmortizedCosts_05.2025.csv

and now it is easy to set up to load them using Folder.Files and StartRange and EndRange paramenters.

but how to select some days from different time ranges for example 01.04 and 07.04 (only 2 days)?
How to make these set up with parameters?

Best,
Jacek

  • Ok solution will be:

    - Introducing 4 parameters:

    1) Granularity : monthly, daily, yearly
    2) Year
    3) Month
    4) Day

    If user will choose Daily granularity, he can put as Days parameter 1, 2, 3-5 so it means that for given year and month it will select partitions like 2025, 04, and days : 1,2, 3,4, 5. 

    So based on this i can selectivly choose which data has to be imported. 

    Best,
    Jacek



6 Replies

  • What do you mean by "select"  ?  Are you looking to selectively refresh partitions?

    • lbendlin's avatar
      lbendlin
      Super User

      Use your tool of choice (SSMS, PowerShell, Power Automate etc) to issue the appropriate XMLA script commands to the semantic model.

       

      {
      "refresh": {
      "type": "full",
      "objects": [
      {
      "database": "NA Cube",
      "table": "Facts",
      "partition": "2023Q1"
      },
      {
      "database": "NA Cube",
      "table": "Facts",
      "partition": "2024Q3"
      },
      {
      "database": "NA Cube",
      "table": "Facts",
      "partition": "2025Q1"
      },
      {
      "database": "NA Cube",
      "table": "Facts",
      "partition": "2025Q2"
      }
      ]
      }
      }
      • v-dineshya's avatar
        v-dineshya
        Community Support

        Hi jaryszek ,

        Thank you for reaching out to the Microsoft Community Forum.

         

        Hi lbendlin , Thank you for your prompt response.

         

        Hi jaryszek ,  Could you please try the proposed solution shared by lbendlin . Please do let us know if you have any further queries.

         

        Regards,

        Dinesh

  • Ok solution will be:

    - Introducing 4 parameters:

    1) Granularity : monthly, daily, yearly
    2) Year
    3) Month
    4) Day

    If user will choose Daily granularity, he can put as Days parameter 1, 2, 3-5 so it means that for given year and month it will select partitions like 2025, 04, and days : 1,2, 3,4, 5. 

    So based on this i can selectivly choose which data has to be imported. 

    Best,
    Jacek