bi-superpowers 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +31 -0
- package/.claude-plugin/plugin.json +34 -0
- package/.claude-plugin/skill-manifest.json +79 -0
- package/.mcp.json +13 -0
- package/.plugin/plugin.json +14 -0
- package/LICENSE +21 -0
- package/README.md +849 -0
- package/bin/build-plugin.js +97 -0
- package/bin/cli.js +891 -0
- package/bin/commands/autoupdate.js +128 -0
- package/bin/commands/build-desktop.js +368 -0
- package/bin/commands/create-from-template.js +165 -0
- package/bin/commands/diff.js +435 -0
- package/bin/commands/install.js +542 -0
- package/bin/commands/lint.js +441 -0
- package/bin/commands/mcp-setup.js +255 -0
- package/bin/commands/session-update.js +204 -0
- package/bin/commands/smoke-test.js +20 -0
- package/bin/commands/uninstall.js +611 -0
- package/bin/commands/update-check.js +427 -0
- package/bin/commands/validate-cases.js +264 -0
- package/bin/commands/validate-projects.js +426 -0
- package/bin/commands/watch.js +251 -0
- package/bin/lib/agents.js +62 -0
- package/bin/lib/base-template-smoke.js +299 -0
- package/bin/lib/claude-hooks.js +160 -0
- package/bin/lib/generators/claude-plugin.js +529 -0
- package/bin/lib/generators/index.js +116 -0
- package/bin/lib/generators/shared.js +257 -0
- package/bin/lib/mcp-config.js +835 -0
- package/bin/lib/microsoft-mcp.js +206 -0
- package/bin/lib/powerbi-mcp-session.js +140 -0
- package/bin/lib/skills.js +164 -0
- package/bin/lib/template-scaffold.js +366 -0
- package/bin/mcp/powerbi-modeling-launcher.js +42 -0
- package/bin/postinstall.js +50 -0
- package/bin/utils/mcp-detect.js +346 -0
- package/bin/utils/tui.js +314 -0
- package/commands/bi-connect.md +520 -0
- package/commands/bi-dax.md +464 -0
- package/commands/bi-kickoff.md +550 -0
- package/commands/bi-modeling.md +485 -0
- package/commands/bi-performance.md +521 -0
- package/commands/bi-powerquery.md +229 -0
- package/commands/bi-refactor.md +249 -0
- package/commands/bi-scorecard.md +268 -0
- package/commands/bi-start.md +272 -0
- package/config.example.json +23 -0
- package/config.json +23 -0
- package/desktop-extension/manifest.json +30 -0
- package/desktop-extension/package.json +10 -0
- package/desktop-extension/server.js +137 -0
- package/package.json +94 -0
- package/skills/bi-connect/SKILL.md +522 -0
- package/skills/bi-connect/scripts/update-check.js +427 -0
- package/skills/bi-dax/SKILL.md +466 -0
- package/skills/bi-dax/scripts/update-check.js +427 -0
- package/skills/bi-kickoff/SKILL.md +552 -0
- package/skills/bi-kickoff/references/flow.html +78 -0
- package/skills/bi-kickoff/references/flow.md +62 -0
- package/skills/bi-kickoff/scripts/update-check.js +427 -0
- package/skills/bi-modeling/SKILL.md +487 -0
- package/skills/bi-modeling/scripts/update-check.js +427 -0
- package/skills/bi-performance/SKILL.md +523 -0
- package/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
- package/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
- package/skills/bi-performance/scripts/update-check.js +427 -0
- package/skills/bi-powerquery/SKILL.md +231 -0
- package/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
- package/skills/bi-powerquery/references/power-query-standards.md +74 -0
- package/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
- package/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
- package/skills/bi-powerquery/scripts/update-check.js +427 -0
- package/skills/bi-refactor/SKILL.md +251 -0
- package/skills/bi-refactor/references/flow.md +27 -0
- package/skills/bi-refactor/scripts/update-check.js +427 -0
- package/skills/bi-scorecard/SKILL.md +270 -0
- package/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
- package/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
- package/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
- package/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
- package/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
- package/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
- package/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
- package/skills/bi-scorecard/scripts/update-check.js +427 -0
- package/skills/bi-start/SKILL.md +274 -0
- package/skills/bi-start/scripts/update-check.js +427 -0
- package/src/content/base.md +197 -0
- package/src/content/mcp-requirements.json +57 -0
- package/src/content/routing.md +201 -0
- package/src/content/skills/bi-connect.md +493 -0
- package/src/content/skills/bi-dax.md +437 -0
- package/src/content/skills/bi-kickoff/SKILL.md +523 -0
- package/src/content/skills/bi-kickoff/references/flow.html +78 -0
- package/src/content/skills/bi-kickoff/references/flow.md +62 -0
- package/src/content/skills/bi-modeling.md +458 -0
- package/src/content/skills/bi-performance/SKILL.md +494 -0
- package/src/content/skills/bi-performance/scripts/install-tabular-editor.ps1 +159 -0
- package/src/content/skills/bi-performance/scripts/run-bpa.ps1 +265 -0
- package/src/content/skills/bi-powerquery/SKILL.md +202 -0
- package/src/content/skills/bi-powerquery/references/base-template-data-contract.md +323 -0
- package/src/content/skills/bi-powerquery/references/power-query-standards.md +74 -0
- package/src/content/skills/bi-powerquery/scripts/new-powerquery-staging.ps1 +371 -0
- package/src/content/skills/bi-powerquery/scripts/test-powerquery-contract.ps1 +225 -0
- package/src/content/skills/bi-refactor/SKILL.md +222 -0
- package/src/content/skills/bi-refactor/references/flow.md +27 -0
- package/src/content/skills/bi-scorecard/SKILL.md +241 -0
- package/src/content/skills/bi-scorecard/examples/base-template-scorecard-blueprint.expected.json +105 -0
- package/src/content/skills/bi-scorecard/examples/base-template-scorecard-overlay.json +82 -0
- package/src/content/skills/bi-scorecard/scripts/new-scorecard-blueprint-from-base-template.ps1 +124 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goal-status-rules-api.ps1 +39 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goal-values-api.ps1 +48 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-goals-api.ps1 +68 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-rest-common.ps1 +197 -0
- package/src/content/skills/bi-scorecard/scripts/powerbi-scorecards-api.ps1 +53 -0
- package/src/content/skills/bi-start.md +266 -0
- package/templates/base-template/AGENTS.md +33 -0
- package/templates/base-template/base-template.Report/.platform +11 -0
- package/templates/base-template/base-template.Report/StaticResources/RegisteredResources/BISuperpowers.json +3888 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/CY18SU07.json +177 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BaseThemes/Fluent2-CY26SU03.json +4104 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleCityPark.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleDefault.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleNeutral.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleOrchid.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/AccessibleTidal.json +26 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Bloom.json +139 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CityPark.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Classroom.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/ColorblindSafe.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/CopilotDefault.json +1861 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Divergent.json +127 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Electric.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Frontier.json +136 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/HighContrast.json +40 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Highrise.json +41 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Innovate.json +227 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/NewExecutive.json +41 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Solar.json +33 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Storm.json +25 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Sunset.json +48 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Temperature.json +33 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Tidal.json +100 -0
- package/templates/base-template/base-template.Report/StaticResources/SharedResources/BuiltInThemes/Twilight.json +40 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/1d40d43c7ade66e8603c.bookmark.json +2297 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/af068ff51c0ca3089ea7.bookmark.json +2300 -0
- package/templates/base-template/base-template.Report/definition/bookmarks/bookmarks.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/page.json +130 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/0352fd80d074693a65db/visual.json +669 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/1c5a14bf493697344b68/visual.json +723 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/3486cf7624c5b109b4e5/visual.json +333 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/4d8b989008edc0db28d1/visual.json +109 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/mobile.json +31 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/55e10ac7d76a1954f94f/visual.json +378 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/57f52ecf4490f70e4da1/visual.json +175 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/5f4d76bbc870118e9840/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/73629e1abebb7a444b59/visual.json +359 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/749cb1388c7e0a88161c/visual.json +690 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/90677f13cea5d1275990/visual.json +17 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/92cf92e3da10493adb78/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/mobile.json +10 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/9fe17b1971f68443fc15/visual.json +328 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a30bd0950630ed94e8a3/visual.json +578 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/a56e91d9400a835e4814/visual.json +432 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/aded24cd205c0b528642/visual.json +801 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/mobile.json +37 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/af34b26f14a8a724c9a9/visual.json +1318 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/b529688fe5a226643322/visual.json +209 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/c4c6f332d05e72e2eb06/visual.json +174 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/mobile.json +29 -0
- package/templates/base-template/base-template.Report/definition/pages/6a4808bb8bb9166f49ff/visuals/fa81f184e2cb0e8b087c/visual.json +241 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/page.json +130 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/07e9c4302e29029c5462/visual.json +690 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/109ceede4bc015b0c006/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/118257e006d472277e10/visual.json +359 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/2caf02e0137c4a1280cc/visual.json +669 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/311e76fe3c9edad68204/visual.json +109 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/31c21f8cbeb3b208940a/visual.json +209 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/3ab72c25062437149b03/visual.json +17 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5959867442abcb0ce2b3/visual.json +788 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/5b96e0f88d192b044a13/visual.json +592 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/64e749a63d0786000e22/visual.json +468 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/7ae1ca604edac6586ad0/visual.json +1310 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/840300733885141a6603/visual.json +175 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/a38448cdb203279273d2/visual.json +516 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d1e86f213a3841d12e20/visual.json +328 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d4a484c1bcc8ee3075e2/visual.json +432 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/d87cb5cf06acca19bbb5/visual.json +241 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/e243da2677209ed69408/visual.json +174 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/mobile.json +11 -0
- package/templates/base-template/base-template.Report/definition/pages/9a5b670b015cab882629/visuals/f3aaf24f5b22b67573b0/visual.json +333 -0
- package/templates/base-template/base-template.Report/definition/pages/pages.json +8 -0
- package/templates/base-template/base-template.Report/definition/report.json +89 -0
- package/templates/base-template/base-template.Report/definition/version.json +4 -0
- package/templates/base-template/base-template.Report/definition.pbir +9 -0
- package/templates/base-template/base-template.SemanticModel/.platform +11 -0
- package/templates/base-template/base-template.SemanticModel/definition/cultures/es-AR.tmdl +11185 -0
- package/templates/base-template/base-template.SemanticModel/definition/database.tmdl +3 -0
- package/templates/base-template/base-template.SemanticModel/definition/expressions.tmdl +234 -0
- package/templates/base-template/base-template.SemanticModel/definition/functions.tmdl +637 -0
- package/templates/base-template/base-template.SemanticModel/definition/model.tmdl +82 -0
- package/templates/base-template/base-template.SemanticModel/definition/relationships.tmdl +271 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Calendario.tmdl +200 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Campa/303/261as.tmdl +75 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Canales.tmdl +84 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Clientes.tmdl +143 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Devoluciones.tmdl +95 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Ejecuci/303/263n proyectos.tmdl" +130 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Entregas.tmdl +122 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos m/303/251tricas.tmdl" +40 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Equipos.tmdl +73 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Horas.tmdl +122 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Interacciones clientes.tmdl +146 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Leads.tmdl +119 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Monedas.tmdl +44 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Movimientos financieros.tmdl +145 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/M/303/251tricas.tmdl +1294 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/N/303/263mina.tmdl +110 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Oportunidades.tmdl +135 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Presupuesto.tmdl +125 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Productos.tmdl +98 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Proyectos.tmdl +77 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Servicios.tmdl +75 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Tareas proyecto.tmdl +102 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Tipo de cambio.tmdl +67 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/Ventas.tmdl +180 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux An/303/241lisis dimensiones.tmdl" +38 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Comparaciones.tmdl +227 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Compatibilidad m/303/251trica-dimensi/303/263n.tmdl" +68 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modelo configuraci/303/263n.tmdl" +44 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Modo fechas.tmdl +36 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux M/303/251trica-Equipo.tmdl" +102 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Overrides m/303/251trica-dimensi/303/263n.tmdl" +54 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Per/303/255odos.tmdl" +182 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas modo.tmdl +36 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Rango fechas.tmdl +27 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_Aux Vista de calendario.tmdl +30 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC C/303/241lculo.tmdl" +70 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Eje X.tmdl +63 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC M/303/251trica.tmdl" +374 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_GC Tipo c/303/241lculo.tmdl" +223 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Dimensi/303/263n.tmdl" +98 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables/_PC Eje X.tmdl +68 -0
- package/templates/base-template/base-template.SemanticModel/definition/tables//303/223rdenes servicio.tmdl" +151 -0
- package/templates/base-template/base-template.SemanticModel/definition.pbism +5 -0
- package/templates/base-template/base-template.SemanticModel/diagramLayout.json +568 -0
- package/templates/base-template/base-template.pbip +14 -0
- package/templates/base-template/template.manifest.json +41 -0
- package/theme/BISuperpowers.json +3888 -0
package/templates/base-template/base-template.SemanticModel/definition/tables/N/303/263mina.tmdl
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/// Hecho demo mensual de headcount, costo laboral y bajas.
|
|
2
|
+
table Nómina
|
|
3
|
+
isHidden
|
|
4
|
+
lineageTag: 847943ce-8ab1-4dee-9858-ff1eefbe90bb
|
|
5
|
+
|
|
6
|
+
column NominaId
|
|
7
|
+
dataType: string
|
|
8
|
+
isHidden
|
|
9
|
+
lineageTag: 912b5421-adda-4080-90cd-5990159af5e1
|
|
10
|
+
sourceColumn: NominaId
|
|
11
|
+
|
|
12
|
+
column Fecha
|
|
13
|
+
dataType: dateTime
|
|
14
|
+
formatString: Long Date
|
|
15
|
+
lineageTag: ba960dc1-5e2e-4218-97fb-34715834e2e7
|
|
16
|
+
summarizeBy: none
|
|
17
|
+
sourceColumn: Fecha
|
|
18
|
+
|
|
19
|
+
annotation UnderlyingDateTimeDataType = Date
|
|
20
|
+
|
|
21
|
+
annotation SummarizationSetBy = Automatic
|
|
22
|
+
|
|
23
|
+
column EquipoId
|
|
24
|
+
dataType: string
|
|
25
|
+
isHidden
|
|
26
|
+
lineageTag: 778dadcd-774c-4bff-8377-891033e010ae
|
|
27
|
+
sourceColumn: EquipoId
|
|
28
|
+
|
|
29
|
+
column ProyectoId
|
|
30
|
+
dataType: string
|
|
31
|
+
isHidden
|
|
32
|
+
lineageTag: d5ceb674-47af-421a-bcf3-23851dc25d3e
|
|
33
|
+
sourceColumn: ProyectoId
|
|
34
|
+
|
|
35
|
+
column ServicioId
|
|
36
|
+
dataType: string
|
|
37
|
+
isHidden
|
|
38
|
+
lineageTag: 33abf17e-55c0-4dd4-b40d-e5367301b5c7
|
|
39
|
+
sourceColumn: ServicioId
|
|
40
|
+
|
|
41
|
+
column Headcount
|
|
42
|
+
dataType: int64
|
|
43
|
+
lineageTag: ae0eee3e-84e1-498e-9c90-9f3e0aeb9ffe
|
|
44
|
+
sourceColumn: Headcount
|
|
45
|
+
|
|
46
|
+
column 'Costo Laboral Base'
|
|
47
|
+
dataType: double
|
|
48
|
+
lineageTag: dc3af51f-e34a-4929-952d-091d3ba50657
|
|
49
|
+
sourceColumn: Costo Laboral Base
|
|
50
|
+
|
|
51
|
+
column Bajas
|
|
52
|
+
dataType: int64
|
|
53
|
+
lineageTag: 1d3674e7-8f7f-4bd6-b82a-980413b39b9c
|
|
54
|
+
sourceColumn: Bajas
|
|
55
|
+
|
|
56
|
+
column Data
|
|
57
|
+
dataType: string
|
|
58
|
+
lineageTag: f491f807-4869-4d42-8a24-c0edf8b3b7d9
|
|
59
|
+
sourceColumn: Data
|
|
60
|
+
|
|
61
|
+
partition Nómina = m
|
|
62
|
+
mode: import
|
|
63
|
+
queryGroup: 'Sample Dataset\Hechos'
|
|
64
|
+
source =
|
|
65
|
+
let
|
|
66
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
67
|
+
let
|
|
68
|
+
CleanNumber = Number.From(n),
|
|
69
|
+
ToLetters = (value as number) as text =>
|
|
70
|
+
let
|
|
71
|
+
Current = Number.IntegerDivide(value, 1),
|
|
72
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
73
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
74
|
+
in
|
|
75
|
+
Prefix & Suffix,
|
|
76
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
77
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
78
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
79
|
+
in
|
|
80
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
81
|
+
CalendarDates = Table.TransformColumnTypes(Table.SelectColumns(Calendario, {"Fecha"}), {{"Fecha", type date}}),
|
|
82
|
+
EndDate = List.Max(CalendarDates[Fecha]),
|
|
83
|
+
StartDate = List.Min(CalendarDates[Fecha]),
|
|
84
|
+
DateWindow = Table.SelectRows(CalendarDates, each [Fecha] >= StartDate and [Fecha] <= EndDate),
|
|
85
|
+
WeekTable = Table.Distinct(Table.AddColumn(DateWindow, "WeekStart", each Date.StartOfWeek([Fecha], Day.Monday), type date)[[WeekStart]]),
|
|
86
|
+
SortedWeeks = Table.Sort(WeekTable, {{"WeekStart", Order.Ascending}}),
|
|
87
|
+
AddSemanaIndex = Table.AddIndexColumn(SortedWeeks, "SemanaIndex", 0, 1, Int64.Type),
|
|
88
|
+
ProjectCount = Table.RowCount(Proyectos),
|
|
89
|
+
EquipoCount = Table.RowCount(Equipos),
|
|
90
|
+
ServiceCount = Table.RowCount(Servicios),
|
|
91
|
+
ProjectsBase = Table.FromList(List.Numbers(1, ProjectCount), Splitter.SplitByNothing(), {"ProyectoNr"}),
|
|
92
|
+
EquiposBase = Table.FromList(List.Numbers(1, EquipoCount), Splitter.SplitByNothing(), {"EquipoNr"}),
|
|
93
|
+
AddProjects = Table.AddColumn(AddSemanaIndex, "Proyectos", each ProjectsBase),
|
|
94
|
+
ExpandProjects = Table.ExpandTableColumn(AddProjects, "Proyectos", {"ProyectoNr"}, {"ProyectoNr"}),
|
|
95
|
+
AddEquipos = Table.AddColumn(ExpandProjects, "Equipos", each EquiposBase),
|
|
96
|
+
ExpandEquipos = Table.ExpandTableColumn(AddEquipos, "Equipos", {"EquipoNr"}, {"EquipoNr"}),
|
|
97
|
+
AddValue = Table.AddColumn(ExpandEquipos, "Value", each [SemanaIndex] * ProjectCount * EquipoCount + ([ProyectoNr] - 1) * EquipoCount + [EquipoNr], Int64.Type),
|
|
98
|
+
AddFecha = Table.AddColumn(AddValue, "Fecha", each List.Min({EndDate, List.Max({StartDate, Date.AddDays([WeekStart], Number.Mod([ProyectoNr] + [EquipoNr] + [SemanaIndex], 7))})}), type date),
|
|
99
|
+
#"Con NominaId" = Table.AddColumn(AddFecha, "NominaId", each EntityCode("Nomina", [Value]), type text),
|
|
100
|
+
#"Con EquipoId" = Table.AddColumn(#"Con NominaId", "EquipoId", each EntityCode("Equipo", [EquipoNr]), type text),
|
|
101
|
+
#"Con ProyectoId" = Table.AddColumn(#"Con EquipoId", "ProyectoId", each EntityCode("Proyecto", [ProyectoNr]), type text),
|
|
102
|
+
#"Con ServicioId" = Table.AddColumn(#"Con ProyectoId", "ServicioId", each EntityCode("Servicio", Number.Mod([ProyectoNr] + [EquipoNr] + [SemanaIndex] - 1, ServiceCount) + 1), type text),
|
|
103
|
+
#"Con Headcount" = Table.AddColumn(#"Con ServicioId", "Headcount", each 12 + Number.Mod([Value] * 2, 45), Int64.Type),
|
|
104
|
+
#"Con Costo Laboral Base" = Table.AddColumn(#"Con Headcount", "Costo Laboral Base", each 18000 + Number.Mod([Value] * 1579 + [SemanaIndex] * 107, 82000), type number),
|
|
105
|
+
#"Con Bajas" = Table.AddColumn(#"Con Costo Laboral Base", "Bajas", each Number.Mod([Value], 6), Int64.Type),
|
|
106
|
+
#"Con Data" = Table.AddColumn(#"Con Bajas", "Data", each "Demo", type text),
|
|
107
|
+
Result = Table.SelectColumns(#"Con Data", {"NominaId", "Fecha", "EquipoId", "ProyectoId", "ServicioId", "Headcount", "Costo Laboral Base", "Bajas", "Data"})
|
|
108
|
+
in
|
|
109
|
+
Result
|
|
110
|
+
|
package/templates/base-template/base-template.SemanticModel/definition/tables/Oportunidades.tmdl
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/// Hecho demo de oportunidades comerciales de Andina Nexus. Complementa Ventas para métricas de pipeline y conversión.
|
|
2
|
+
table Oportunidades
|
|
3
|
+
isHidden
|
|
4
|
+
lineageTag: 5ad84ec0-5b65-470d-9407-f58cfea2f178
|
|
5
|
+
|
|
6
|
+
column OportunidadId
|
|
7
|
+
dataType: string
|
|
8
|
+
isHidden
|
|
9
|
+
lineageTag: 00640ed0-b5dc-4dda-87b7-d6801bdf60a0
|
|
10
|
+
sourceColumn: OportunidadId
|
|
11
|
+
|
|
12
|
+
column Fecha
|
|
13
|
+
dataType: dateTime
|
|
14
|
+
formatString: Long Date
|
|
15
|
+
lineageTag: 97e57d9f-dd93-42a7-a4c9-26a2bd50fa50
|
|
16
|
+
summarizeBy: none
|
|
17
|
+
sourceColumn: Fecha
|
|
18
|
+
|
|
19
|
+
annotation UnderlyingDateTimeDataType = Date
|
|
20
|
+
|
|
21
|
+
annotation SummarizationSetBy = Automatic
|
|
22
|
+
|
|
23
|
+
column ClienteId
|
|
24
|
+
dataType: string
|
|
25
|
+
isHidden
|
|
26
|
+
lineageTag: 22e68881-32ad-412d-9630-cc034df8ec7f
|
|
27
|
+
sourceColumn: ClienteId
|
|
28
|
+
|
|
29
|
+
column CanalId
|
|
30
|
+
dataType: string
|
|
31
|
+
isHidden
|
|
32
|
+
lineageTag: 3945a2bd-9757-4920-86a1-33e0f1e0f0d1
|
|
33
|
+
sourceColumn: CanalId
|
|
34
|
+
|
|
35
|
+
column ProductoId
|
|
36
|
+
dataType: string
|
|
37
|
+
isHidden
|
|
38
|
+
lineageTag: 53122e42-88e1-45eb-a510-03df00da2199
|
|
39
|
+
sourceColumn: ProductoId
|
|
40
|
+
|
|
41
|
+
column ServicioId
|
|
42
|
+
dataType: string
|
|
43
|
+
isHidden
|
|
44
|
+
lineageTag: 82274caf-b946-4835-83fd-a7998c3b0ed9
|
|
45
|
+
sourceColumn: ServicioId
|
|
46
|
+
|
|
47
|
+
column Estado
|
|
48
|
+
dataType: string
|
|
49
|
+
lineageTag: 2799ad77-27e6-4512-af01-89c3292f3f0e
|
|
50
|
+
sourceColumn: Estado
|
|
51
|
+
|
|
52
|
+
column 'Importe Potencial Base'
|
|
53
|
+
dataType: double
|
|
54
|
+
lineageTag: 916455c3-639f-48d4-a4c6-a115dcf1228b
|
|
55
|
+
sourceColumn: Importe Potencial Base
|
|
56
|
+
|
|
57
|
+
column Probabilidad
|
|
58
|
+
dataType: double
|
|
59
|
+
lineageTag: b5d7835e-ddf3-4b3d-b0c1-7de19212daba
|
|
60
|
+
sourceColumn: Probabilidad
|
|
61
|
+
|
|
62
|
+
column Data
|
|
63
|
+
dataType: string
|
|
64
|
+
lineageTag: 1e392d83-928d-4b7d-ae1b-3952f74c2526
|
|
65
|
+
sourceColumn: Data
|
|
66
|
+
|
|
67
|
+
partition Oportunidades = m
|
|
68
|
+
mode: import
|
|
69
|
+
queryGroup: 'Sample Dataset\Hechos'
|
|
70
|
+
source =
|
|
71
|
+
let
|
|
72
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
73
|
+
let
|
|
74
|
+
CleanNumber = Number.From(n),
|
|
75
|
+
ToLetters = (value as number) as text =>
|
|
76
|
+
let
|
|
77
|
+
Current = Number.IntegerDivide(value, 1),
|
|
78
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
79
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
80
|
+
in
|
|
81
|
+
Prefix & Suffix,
|
|
82
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
83
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
84
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
85
|
+
in
|
|
86
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
87
|
+
CalendarDates = Table.TransformColumnTypes(Table.SelectColumns(Calendario, {"Fecha"}), {{"Fecha", type date}}),
|
|
88
|
+
EndDate = List.Max(CalendarDates[Fecha]),
|
|
89
|
+
StartDate = List.Min(CalendarDates[Fecha]),
|
|
90
|
+
DateWindow = Table.SelectRows(CalendarDates, each [Fecha] >= StartDate and [Fecha] <= EndDate),
|
|
91
|
+
WeekTable = Table.Distinct(Table.AddColumn(DateWindow, "WeekStart", each Date.StartOfWeek([Fecha], Day.Monday), type date)[[WeekStart]]),
|
|
92
|
+
SortedWeeks = Table.Sort(WeekTable, {{"WeekStart", Order.Ascending}}),
|
|
93
|
+
AddSemanaIndex = Table.AddIndexColumn(SortedWeeks, "SemanaIndex", 0, 1, Int64.Type),
|
|
94
|
+
ClienteCount = Table.RowCount(Clientes),
|
|
95
|
+
ProductCount = Table.RowCount(Productos),
|
|
96
|
+
ServiceCount = Table.RowCount(Servicios),
|
|
97
|
+
ChannelCount = Table.RowCount(Canales),
|
|
98
|
+
ClientesBase = Table.FromList(List.Numbers(1, ClienteCount), Splitter.SplitByNothing(), {"ClienteNr"}),
|
|
99
|
+
AddClientes = Table.AddColumn(AddSemanaIndex, "Clientes", each ClientesBase),
|
|
100
|
+
ExpandClientes = Table.ExpandTableColumn(AddClientes, "Clientes", {"ClienteNr"}, {"ClienteNr"}),
|
|
101
|
+
AddValue = Table.AddColumn(ExpandClientes, "Value", each [SemanaIndex] * ClienteCount + [ClienteNr], Int64.Type),
|
|
102
|
+
AddFecha = Table.AddColumn(AddValue, "Fecha", each List.Min({EndDate, List.Max({StartDate, Date.AddDays([WeekStart], Number.Mod([ClienteNr] + [SemanaIndex], 7))})}), type date),
|
|
103
|
+
#"Con OportunidadId" = Table.AddColumn(AddFecha, "OportunidadId", each EntityCode("Oportunidad", [Value]), type text),
|
|
104
|
+
#"Con ClienteId" = Table.AddColumn(#"Con OportunidadId", "ClienteId", each EntityCode("Cliente", [ClienteNr]), type text),
|
|
105
|
+
#"Con CanalId" = Table.AddColumn(#"Con ClienteId", "CanalId", each EntityCode("Canal", Number.Mod([ClienteNr] + [SemanaIndex] - 1, ChannelCount) + 1), type text),
|
|
106
|
+
#"Con ProductoId" = Table.AddColumn(#"Con CanalId", "ProductoId", each EntityCode("Producto", Number.Mod([ClienteNr] + [SemanaIndex] * 3 - 1, ProductCount) + 1), type text),
|
|
107
|
+
#"Con ServicioId" = Table.AddColumn(#"Con ProductoId", "ServicioId", each EntityCode("Servicio", Number.Mod([ClienteNr] + [SemanaIndex] * 5 - 1, ServiceCount) + 1), type text),
|
|
108
|
+
JoinClientes = Table.NestedJoin(#"Con ServicioId", {"ClienteId"}, Clientes, {"ClienteId"}, "Cliente", JoinKind.LeftOuter),
|
|
109
|
+
ExpandClientesDim = Table.ExpandTableColumn(JoinClientes, "Cliente", {"País", "Segmento"}, {"País", "Segmento"}),
|
|
110
|
+
JoinCanales = Table.NestedJoin(ExpandClientesDim, {"CanalId"}, Canales, {"CanalId"}, "Canal", JoinKind.LeftOuter),
|
|
111
|
+
ExpandCanales = Table.ExpandTableColumn(JoinCanales, "Canal", {"Canal", "Tipo de canal"}, {"Canal", "Tipo de canal"}),
|
|
112
|
+
#"Con Win Score" = Table.AddColumn(ExpandCanales, "WinScore", each
|
|
113
|
+
let
|
|
114
|
+
CountryScore = if [País] = "Brasil" then 18 else if [País] = "Mexico" then 16 else if [País] = "España" then 15 else if [País] = "Colombia" then 12 else if [País] = "Chile" then 10 else if [País] = "Argentina" then 7 else if [País] = "Peru" then 6 else if [País] = "Haiti" then -8 else if [País] = "Cuba" then -6 else if [País] = "Nicaragua" then -5 else if [País] = "Bolivia" then -4 else 0,
|
|
115
|
+
SegmentScore = if [Segmento] = "Enterprise" then 10 else if [Segmento] = "Mid Market" then 3 else -5,
|
|
116
|
+
ChannelScore = if [Canal] = "Directo" then 8 else if [Canal] = "Partner" then 3 else if [Canal] = "Marketplace" then -2 else -5,
|
|
117
|
+
RecencyScore = if [SemanaIndex] >= 78 then 4 else if [SemanaIndex] >= 52 then 1 else -2
|
|
118
|
+
in
|
|
119
|
+
18 + CountryScore + SegmentScore + ChannelScore + RecencyScore,
|
|
120
|
+
type number),
|
|
121
|
+
#"Con Estado" = Table.AddColumn(#"Con Win Score", "Estado", each
|
|
122
|
+
let
|
|
123
|
+
Score = Number.Mod([Value] * 13 + [SemanaIndex] * 7 + [ClienteNr] * 5, 100),
|
|
124
|
+
WinThreshold = List.Min({48, List.Max({7, [WinScore]})}),
|
|
125
|
+
LossThreshold = List.Min({92, List.Max({58, 78 - [WinScore] / 3})})
|
|
126
|
+
in
|
|
127
|
+
if Score < WinThreshold then "Ganada" else if Score > LossThreshold then "Perdida" else "Abierta",
|
|
128
|
+
type text),
|
|
129
|
+
#"Con Importe Potencial Base" = Table.AddColumn(#"Con Estado", "Importe Potencial Base", each (18000 + Number.Mod([Value] * 987 + [SemanaIndex] * 211, 90000)) * (0.78 + List.Max({0, [WinScore]}) / 55), type number),
|
|
130
|
+
#"Con Probabilidad" = Table.AddColumn(#"Con Importe Potencial Base", "Probabilidad", each let r = Number.Mod([Value], 4) in if r = 0 then 0.25 else if r = 1 then 0.45 else if r = 2 then 0.65 else 0.8, type number),
|
|
131
|
+
#"Con Data" = Table.AddColumn(#"Con Probabilidad", "Data", each "Demo", type text),
|
|
132
|
+
Result = Table.SelectColumns(#"Con Data", {"OportunidadId", "Fecha", "ClienteId", "CanalId", "ProductoId", "ServicioId", "Estado", "Importe Potencial Base", "Probabilidad", "Data"})
|
|
133
|
+
in
|
|
134
|
+
Result
|
|
135
|
+
|
package/templates/base-template/base-template.SemanticModel/definition/tables/Presupuesto.tmdl
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/// Hecho demo de presupuesto por fecha y área para comparar ejecución contra plan.
|
|
2
|
+
table Presupuesto
|
|
3
|
+
isHidden
|
|
4
|
+
lineageTag: 5be275c4-3142-4f4c-bb8f-c3c9ffc67b2d
|
|
5
|
+
|
|
6
|
+
column PresupuestoId
|
|
7
|
+
dataType: string
|
|
8
|
+
isHidden
|
|
9
|
+
lineageTag: f2c05508-037f-43c5-85af-adecc8f5f3cc
|
|
10
|
+
sourceColumn: PresupuestoId
|
|
11
|
+
|
|
12
|
+
column Fecha
|
|
13
|
+
dataType: dateTime
|
|
14
|
+
formatString: Long Date
|
|
15
|
+
lineageTag: 3daab46e-9800-49c5-875d-a957b3676d82
|
|
16
|
+
summarizeBy: none
|
|
17
|
+
sourceColumn: Fecha
|
|
18
|
+
|
|
19
|
+
annotation UnderlyingDateTimeDataType = Date
|
|
20
|
+
|
|
21
|
+
annotation SummarizationSetBy = Automatic
|
|
22
|
+
|
|
23
|
+
column ClienteId
|
|
24
|
+
dataType: string
|
|
25
|
+
isHidden
|
|
26
|
+
lineageTag: cce0b397-dcf5-4a18-bc74-c2d7ccda312d
|
|
27
|
+
sourceColumn: ClienteId
|
|
28
|
+
|
|
29
|
+
column CanalId
|
|
30
|
+
dataType: string
|
|
31
|
+
isHidden
|
|
32
|
+
lineageTag: 92ae1434-363c-48f9-a6a3-13ac65ae84a3
|
|
33
|
+
sourceColumn: CanalId
|
|
34
|
+
|
|
35
|
+
column ProductoId
|
|
36
|
+
dataType: string
|
|
37
|
+
isHidden
|
|
38
|
+
lineageTag: 49bb74a0-46f5-4783-9d30-e9fe27358b20
|
|
39
|
+
sourceColumn: ProductoId
|
|
40
|
+
|
|
41
|
+
column ServicioId
|
|
42
|
+
dataType: string
|
|
43
|
+
isHidden
|
|
44
|
+
lineageTag: ba9bebc2-e03c-47b8-8385-0b02b72b1643
|
|
45
|
+
sourceColumn: ServicioId
|
|
46
|
+
|
|
47
|
+
column ProyectoId
|
|
48
|
+
dataType: string
|
|
49
|
+
isHidden
|
|
50
|
+
lineageTag: d1eedd63-5415-4bfb-a6ec-897ec8f25266
|
|
51
|
+
sourceColumn: ProyectoId
|
|
52
|
+
|
|
53
|
+
column EquipoId
|
|
54
|
+
dataType: string
|
|
55
|
+
isHidden
|
|
56
|
+
lineageTag: 4315dbd5-d6da-4790-a08e-656e471919a0
|
|
57
|
+
sourceColumn: EquipoId
|
|
58
|
+
|
|
59
|
+
column 'Área presupuesto'
|
|
60
|
+
dataType: string
|
|
61
|
+
lineageTag: 8b41e3e2-7329-4a28-aa98-5dc08711c7bf
|
|
62
|
+
sourceColumn: Área presupuesto
|
|
63
|
+
|
|
64
|
+
column 'Importe Presupuesto Base'
|
|
65
|
+
dataType: double
|
|
66
|
+
lineageTag: 0f8730f1-6947-4985-89d0-1b5694c72485
|
|
67
|
+
sourceColumn: Importe Presupuesto Base
|
|
68
|
+
|
|
69
|
+
column Data
|
|
70
|
+
dataType: string
|
|
71
|
+
lineageTag: 1824f0bb-1a25-4c73-aa3b-d67eb545f994
|
|
72
|
+
sourceColumn: Data
|
|
73
|
+
|
|
74
|
+
partition Presupuesto = m
|
|
75
|
+
mode: import
|
|
76
|
+
queryGroup: 'Sample Dataset\Hechos'
|
|
77
|
+
source =
|
|
78
|
+
let
|
|
79
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
80
|
+
let
|
|
81
|
+
CleanNumber = Number.From(n),
|
|
82
|
+
ToLetters = (value as number) as text =>
|
|
83
|
+
let
|
|
84
|
+
Current = Number.IntegerDivide(value, 1),
|
|
85
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
86
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
87
|
+
in
|
|
88
|
+
Prefix & Suffix,
|
|
89
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
90
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
91
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
92
|
+
in
|
|
93
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
94
|
+
CalendarDates = Table.TransformColumnTypes(Table.SelectColumns(Calendario, {"Fecha"}), {{"Fecha", type date}}),
|
|
95
|
+
EndDate = List.Max(CalendarDates[Fecha]),
|
|
96
|
+
StartDate = List.Min(CalendarDates[Fecha]),
|
|
97
|
+
DateWindow = Table.SelectRows(CalendarDates, each [Fecha] >= StartDate and [Fecha] <= EndDate),
|
|
98
|
+
WeekTable = Table.Distinct(Table.AddColumn(DateWindow, "WeekStart", each Date.StartOfWeek([Fecha], Day.Monday), type date)[[WeekStart]]),
|
|
99
|
+
SortedWeeks = Table.Sort(WeekTable, {{"WeekStart", Order.Ascending}}),
|
|
100
|
+
AddSemanaIndex = Table.AddIndexColumn(SortedWeeks, "SemanaIndex", 0, 1, Int64.Type),
|
|
101
|
+
ClienteCount = Table.RowCount(Clientes),
|
|
102
|
+
ProductCount = Table.RowCount(Productos),
|
|
103
|
+
ServiceCount = Table.RowCount(Servicios),
|
|
104
|
+
ProjectCount = Table.RowCount(Proyectos),
|
|
105
|
+
EquipoCount = Table.RowCount(Equipos),
|
|
106
|
+
ChannelCount = Table.RowCount(Canales),
|
|
107
|
+
ClientesBase = Table.FromList(List.Numbers(1, ClienteCount), Splitter.SplitByNothing(), {"ClienteNr"}),
|
|
108
|
+
AddClientes = Table.AddColumn(AddSemanaIndex, "Clientes", each ClientesBase),
|
|
109
|
+
ExpandClientes = Table.ExpandTableColumn(AddClientes, "Clientes", {"ClienteNr"}, {"ClienteNr"}),
|
|
110
|
+
AddValue = Table.AddColumn(ExpandClientes, "Value", each [SemanaIndex] * ClienteCount + [ClienteNr], Int64.Type),
|
|
111
|
+
AddFecha = Table.AddColumn(AddValue, "Fecha", each List.Min({EndDate, List.Max({StartDate, Date.AddDays([WeekStart], Number.Mod([ClienteNr] + [SemanaIndex], 7))})}), type date),
|
|
112
|
+
#"Con PresupuestoId" = Table.AddColumn(AddFecha, "PresupuestoId", each EntityCode("Presupuesto", [Value]), type text),
|
|
113
|
+
#"Con ClienteId" = Table.AddColumn(#"Con PresupuestoId", "ClienteId", each EntityCode("Cliente", [ClienteNr]), type text),
|
|
114
|
+
#"Con CanalId" = Table.AddColumn(#"Con ClienteId", "CanalId", each EntityCode("Canal", Number.Mod([ClienteNr] + [SemanaIndex] - 1, ChannelCount) + 1), type text),
|
|
115
|
+
#"Con ProductoId" = Table.AddColumn(#"Con CanalId", "ProductoId", each EntityCode("Producto", Number.Mod([ClienteNr] + [SemanaIndex] * 3 - 1, ProductCount) + 1), type text),
|
|
116
|
+
#"Con ServicioId" = Table.AddColumn(#"Con ProductoId", "ServicioId", each EntityCode("Servicio", Number.Mod([ClienteNr] + [SemanaIndex] * 5 - 1, ServiceCount) + 1), type text),
|
|
117
|
+
#"Con ProyectoId" = Table.AddColumn(#"Con ServicioId", "ProyectoId", each EntityCode("Proyecto", Number.Mod([ClienteNr] + [SemanaIndex] * 7 - 1, ProjectCount) + 1), type text),
|
|
118
|
+
#"Con EquipoId" = Table.AddColumn(#"Con ProyectoId", "EquipoId", each EntityCode("Equipo", Number.Mod([ClienteNr] + [SemanaIndex] - 1, EquipoCount) + 1), type text),
|
|
119
|
+
#"Con Área presupuesto" = Table.AddColumn(#"Con EquipoId", "Área presupuesto", each let r = Number.Mod([Value], 8) in if r = 0 then "Comercial" else if r = 1 then "Marketing" else if r = 2 then "Clientes" else if r = 3 then "Operaciones" else if r = 4 then "Finanzas" else if r = 5 then "Producto" else if r = 6 then "Personas" else "Proyectos", type text),
|
|
120
|
+
#"Con Importe Presupuesto Base" = Table.AddColumn(#"Con Área presupuesto", "Importe Presupuesto Base", each 52000 + Number.Mod([Value] * 2111 + [SemanaIndex] * 409, 90000), type number),
|
|
121
|
+
#"Con Data" = Table.AddColumn(#"Con Importe Presupuesto Base", "Data", each "Demo", type text),
|
|
122
|
+
Result = Table.SelectColumns(#"Con Data", {"PresupuestoId", "Fecha", "ClienteId", "CanalId", "ProductoId", "ServicioId", "ProyectoId", "EquipoId", "Área presupuesto", "Importe Presupuesto Base", "Data"})
|
|
123
|
+
in
|
|
124
|
+
Result
|
|
125
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/// Dimension de productos sintética para ventas, cargada desde Power Query para que el sample dataset no dependa de DAX calculated tables.
|
|
2
|
+
table Productos
|
|
3
|
+
lineageTag: 129abf05-1906-4a84-b7ce-0f26b4b60083
|
|
4
|
+
|
|
5
|
+
column ProductoId
|
|
6
|
+
dataType: string
|
|
7
|
+
isHidden
|
|
8
|
+
lineageTag: ca5f9070-95c1-4d7f-bb7f-dcd5caf63e86
|
|
9
|
+
summarizeBy: none
|
|
10
|
+
sourceColumn: ProductoId
|
|
11
|
+
|
|
12
|
+
column Producto
|
|
13
|
+
dataType: string
|
|
14
|
+
lineageTag: 7251821c-c2b3-4e71-a4f7-a492793acf44
|
|
15
|
+
summarizeBy: none
|
|
16
|
+
sourceColumn: Producto
|
|
17
|
+
|
|
18
|
+
column Categoría
|
|
19
|
+
dataType: string
|
|
20
|
+
lineageTag: f0b5325a-2564-4f0e-9a33-f59b72a49a41
|
|
21
|
+
summarizeBy: none
|
|
22
|
+
sourceColumn: Categoria
|
|
23
|
+
|
|
24
|
+
column Subcategoría
|
|
25
|
+
dataType: string
|
|
26
|
+
lineageTag: 79b4bb01-8955-4f4d-8021-485d2c0b0869
|
|
27
|
+
summarizeBy: none
|
|
28
|
+
sourceColumn: Subcategoria
|
|
29
|
+
|
|
30
|
+
column Data
|
|
31
|
+
dataType: string
|
|
32
|
+
isHidden
|
|
33
|
+
lineageTag: efe03236-3a16-4b81-b944-024eae959bdc
|
|
34
|
+
summarizeBy: none
|
|
35
|
+
sourceColumn: Data
|
|
36
|
+
|
|
37
|
+
/// Drill-down estándar de Productos: Categoría -> Subcategoría -> Producto.
|
|
38
|
+
hierarchy 'Jerarquía de productos'
|
|
39
|
+
lineageTag: 4c61c740-5ac8-4a33-ae38-cc46369099dd
|
|
40
|
+
|
|
41
|
+
level Categoría
|
|
42
|
+
lineageTag: 4f5c233f-66ae-46d0-bc3a-cc19daca8161
|
|
43
|
+
column: Categoría
|
|
44
|
+
|
|
45
|
+
level Subcategoría
|
|
46
|
+
lineageTag: d82a4e44-77c3-4792-a764-a4610c6794f4
|
|
47
|
+
column: Subcategoría
|
|
48
|
+
|
|
49
|
+
level Producto
|
|
50
|
+
lineageTag: f439e85f-0346-4b49-8467-2e639f07364b
|
|
51
|
+
column: Producto
|
|
52
|
+
|
|
53
|
+
partition Productos = m
|
|
54
|
+
mode: import
|
|
55
|
+
queryGroup: 'Sample Dataset\Dimensiones'
|
|
56
|
+
source =
|
|
57
|
+
let
|
|
58
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
59
|
+
let
|
|
60
|
+
CleanNumber = Number.From(n),
|
|
61
|
+
ToLetters = (value as number) as text =>
|
|
62
|
+
let
|
|
63
|
+
Current = Number.IntegerDivide(value, 1),
|
|
64
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
65
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
66
|
+
in
|
|
67
|
+
Prefix & Suffix,
|
|
68
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
69
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
70
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
71
|
+
in
|
|
72
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
73
|
+
Source = #table(
|
|
74
|
+
type table [ProductoId = Int64.Type, Producto = text, Categoria = text, Subcategoria = text],
|
|
75
|
+
{
|
|
76
|
+
{ 1, "Notebook Atlas 14", "Hardware", "Computadoras" },
|
|
77
|
+
{ 2, "Monitor Nexo 27", "Hardware", "Perifericos" },
|
|
78
|
+
{ 3, "Dock Andina USB-C", "Hardware", "Accesorios" },
|
|
79
|
+
{ 4, "Licencia Pulse BI", "Software", "Analytics" },
|
|
80
|
+
{ 5, "Soporte Premium 24x7", "Servicios", "Soporte" },
|
|
81
|
+
{ 6, "Implementacion Data Hub", "Servicios", "Consultoria" },
|
|
82
|
+
{ 7, "Capacitacion Power BI", "Servicios", "Formacion" },
|
|
83
|
+
{ 8, "Integracion API Core", "Software", "Integraciones" }
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
#"Tipo cambiado" = Table.TransformColumnTypes(Source,{{"ProductoId", Int64.Type}, {"Producto", type text}, {"Categoria", type text}, {"Subcategoria", type text}}),
|
|
87
|
+
AddData = Table.AddColumn(#"Tipo cambiado", "Data", each "Demo", type text),
|
|
88
|
+
AddProductoCodigo = Table.AddColumn(AddData, "ProductoCodigo", each EntityCode("Producto", [ProductoId]), type text),
|
|
89
|
+
SelectForOutput = Table.SelectColumns(AddProductoCodigo, {"Data", "ProductoCodigo", "Producto", "Categoria", "Subcategoria"}),
|
|
90
|
+
Result = Table.RenameColumns(SelectForOutput, {{"ProductoCodigo", "ProductoId"}}),
|
|
91
|
+
#"Tipo final" = Table.TransformColumnTypes(Result,{{"Data", type text}, {"ProductoId", type text}, {"Producto", type text}, {"Categoria", type text}, {"Subcategoria", type text}})
|
|
92
|
+
in
|
|
93
|
+
#"Tipo final"
|
|
94
|
+
|
|
95
|
+
annotation PBI_NavigationStepName = Navegación
|
|
96
|
+
|
|
97
|
+
annotation PBI_ResultType = Exception
|
|
98
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/// Dimensión demo de proyectos de Andina Nexus para analizar servicios profesionales, implementación y rentabilidad por proyecto.
|
|
2
|
+
table Proyectos
|
|
3
|
+
lineageTag: d7836937-3372-490f-80e0-73c5b893c474
|
|
4
|
+
|
|
5
|
+
column ProyectoId
|
|
6
|
+
dataType: string
|
|
7
|
+
isHidden
|
|
8
|
+
lineageTag: 1f33b601-65e5-467a-9da3-0fc6807ae3ee
|
|
9
|
+
sourceColumn: ProyectoId
|
|
10
|
+
|
|
11
|
+
column Proyecto
|
|
12
|
+
dataType: string
|
|
13
|
+
lineageTag: fe38bc96-db5a-4654-96cd-16644a17075d
|
|
14
|
+
sourceColumn: Proyecto
|
|
15
|
+
|
|
16
|
+
column 'Tipo proyecto'
|
|
17
|
+
dataType: string
|
|
18
|
+
lineageTag: 74d61899-0207-4066-b57c-b43cf1176c01
|
|
19
|
+
sourceColumn: Tipo proyecto
|
|
20
|
+
|
|
21
|
+
column 'Estado proyecto'
|
|
22
|
+
dataType: string
|
|
23
|
+
lineageTag: ef532c11-0457-413a-bfc5-aca74fe6ff80
|
|
24
|
+
sourceColumn: Estado proyecto
|
|
25
|
+
|
|
26
|
+
column Data
|
|
27
|
+
dataType: string
|
|
28
|
+
isHidden
|
|
29
|
+
lineageTag: 195196a0-3c37-42f5-ba35-a5263d6d3f26
|
|
30
|
+
sourceColumn: Data
|
|
31
|
+
|
|
32
|
+
partition Proyectos = m
|
|
33
|
+
mode: import
|
|
34
|
+
queryGroup: 'Sample Dataset\Dimensiones'
|
|
35
|
+
source =
|
|
36
|
+
let
|
|
37
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
38
|
+
let
|
|
39
|
+
CleanNumber = Number.From(n),
|
|
40
|
+
ToLetters = (value as number) as text =>
|
|
41
|
+
let
|
|
42
|
+
Current = Number.IntegerDivide(value, 1),
|
|
43
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
44
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
45
|
+
in
|
|
46
|
+
Prefix & Suffix,
|
|
47
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
48
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
49
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
50
|
+
in
|
|
51
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
52
|
+
Source = #table(
|
|
53
|
+
type table [ProyectoId = Int64.Type, Proyecto = text, #"Tipo proyecto" = text, #"Estado proyecto" = text],
|
|
54
|
+
{
|
|
55
|
+
{1, "Atlas Retail BI", "Implementación", "Activo"},
|
|
56
|
+
{2, "Norte Forecast", "Analítica avanzada", "En riesgo"},
|
|
57
|
+
{3, "Pacífico ERP Sync", "Integración", "Activo"},
|
|
58
|
+
{4, "Austral Revenue Ops", "Automatización", "Activo"},
|
|
59
|
+
{5, "Andes Data Governance", "Gobierno", "Planificado"},
|
|
60
|
+
{6, "Pampa Enablement", "Capacitación", "Cerrado"},
|
|
61
|
+
{7, "Litoral Service Desk", "Soporte", "Activo"},
|
|
62
|
+
{8, "Iberia Executive Pack", "Implementación", "En riesgo"},
|
|
63
|
+
{9, "Caribe Customer 360", "Analítica avanzada", "Activo"},
|
|
64
|
+
{10, "Patagonia Margin Lab", "Gobierno", "Cerrado"}
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
#"Tipo cambiado" = Table.TransformColumnTypes(Source, {{"ProyectoId", Int64.Type}, {"Proyecto", type text}, {"Tipo proyecto", type text}, {"Estado proyecto", type text}}, "es-ES"),
|
|
68
|
+
AddData = Table.AddColumn(#"Tipo cambiado", "Data", each "Demo", type text),
|
|
69
|
+
AddProyectoCodigo = Table.AddColumn(AddData, "ProyectoCodigo", each EntityCode("Proyecto", [ProyectoId]), type text),
|
|
70
|
+
SelectForOutput = Table.SelectColumns(AddProyectoCodigo, {"Data", "ProyectoCodigo", "Proyecto", "Tipo proyecto", "Estado proyecto"}),
|
|
71
|
+
Result = Table.RenameColumns(SelectForOutput, {{"ProyectoCodigo", "ProyectoId"}}),
|
|
72
|
+
#"Tipo final" = Table.TransformColumnTypes(Result, {{"Data", type text}, {"ProyectoId", type text}, {"Proyecto", type text}, {"Tipo proyecto", type text}, {"Estado proyecto", type text}}, "es-ES")
|
|
73
|
+
in
|
|
74
|
+
#"Tipo final"
|
|
75
|
+
|
|
76
|
+
annotation PBI_ResultType = Table
|
|
77
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/// Dimensión demo de servicios de Andina Nexus, usada para mostrar que el template soporta empresas que venden productos y servicios.
|
|
2
|
+
table Servicios
|
|
3
|
+
lineageTag: 71038caf-394c-4f1b-949e-d9989deee397
|
|
4
|
+
|
|
5
|
+
column ServicioId
|
|
6
|
+
dataType: string
|
|
7
|
+
isHidden
|
|
8
|
+
lineageTag: 04c3368f-200f-4900-b6c8-f117c877e3da
|
|
9
|
+
sourceColumn: ServicioId
|
|
10
|
+
|
|
11
|
+
column Servicio
|
|
12
|
+
dataType: string
|
|
13
|
+
lineageTag: 5e622af6-2302-489f-8a1b-eede0de38039
|
|
14
|
+
sourceColumn: Servicio
|
|
15
|
+
|
|
16
|
+
column 'Línea servicio'
|
|
17
|
+
dataType: string
|
|
18
|
+
lineageTag: 20250f3b-e953-49a4-9917-ea19425e4b45
|
|
19
|
+
sourceColumn: Línea servicio
|
|
20
|
+
|
|
21
|
+
column Modalidad
|
|
22
|
+
dataType: string
|
|
23
|
+
lineageTag: a6563f3a-5418-478b-9631-545320b4d2fe
|
|
24
|
+
sourceColumn: Modalidad
|
|
25
|
+
|
|
26
|
+
column Data
|
|
27
|
+
dataType: string
|
|
28
|
+
isHidden
|
|
29
|
+
lineageTag: 37b4f2cc-c79c-4800-8758-5b46f39c0b3f
|
|
30
|
+
sourceColumn: Data
|
|
31
|
+
|
|
32
|
+
partition Servicios = m
|
|
33
|
+
mode: import
|
|
34
|
+
queryGroup: 'Sample Dataset\Dimensiones'
|
|
35
|
+
source =
|
|
36
|
+
let
|
|
37
|
+
EntityCode = (entity as text, n as number) as text =>
|
|
38
|
+
let
|
|
39
|
+
CleanNumber = Number.From(n),
|
|
40
|
+
ToLetters = (value as number) as text =>
|
|
41
|
+
let
|
|
42
|
+
Current = Number.IntegerDivide(value, 1),
|
|
43
|
+
Prefix = if Current < 26 then "" else @ToLetters(Number.IntegerDivide(Current, 26) - 1),
|
|
44
|
+
Suffix = Character.FromNumber(65 + Number.Mod(Current, 26))
|
|
45
|
+
in
|
|
46
|
+
Prefix & Suffix,
|
|
47
|
+
BlockCode = ToLetters(Number.IntegerDivide(CleanNumber - 1, 100)),
|
|
48
|
+
NumberPart = Text.PadStart(Text.From(Number.Mod(CleanNumber - 1, 100) + 1, "en-US"), 2, "0"),
|
|
49
|
+
CheckLetter = Character.FromNumber(65 + Number.Mod(CleanNumber * 7 + Text.Length(entity) + 3, 26))
|
|
50
|
+
in
|
|
51
|
+
entity & BlockCode & NumberPart & CheckLetter,
|
|
52
|
+
Source = #table(
|
|
53
|
+
type table [ServicioId = Int64.Type, Servicio = text, #"Línea servicio" = text, Modalidad = text],
|
|
54
|
+
{
|
|
55
|
+
{1, "Implementación BI", "Analítica", "Proyecto"},
|
|
56
|
+
{2, "Soporte mensual", "Soporte", "Recurrente"},
|
|
57
|
+
{3, "Consultoría de datos", "Analítica", "Bolsa de horas"},
|
|
58
|
+
{4, "Automatización comercial", "Automatización", "Proyecto"},
|
|
59
|
+
{5, "Capacitación Power BI", "Capacitación", "Workshop"},
|
|
60
|
+
{6, "Gobierno de datos", "Gobierno", "Proyecto"},
|
|
61
|
+
{7, "Integración ERP", "Integración", "Proyecto"},
|
|
62
|
+
{8, "Analytics avanzado", "Analítica", "Recurrente"}
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
#"Tipo cambiado" = Table.TransformColumnTypes(Source, {{"ServicioId", Int64.Type}, {"Servicio", type text}, {"Línea servicio", type text}, {"Modalidad", type text}}, "es-ES"),
|
|
66
|
+
AddData = Table.AddColumn(#"Tipo cambiado", "Data", each "Demo", type text),
|
|
67
|
+
AddServicioCodigo = Table.AddColumn(AddData, "ServicioCodigo", each EntityCode("Servicio", [ServicioId]), type text),
|
|
68
|
+
SelectForOutput = Table.SelectColumns(AddServicioCodigo, {"Data", "ServicioCodigo", "Servicio", "Línea servicio", "Modalidad"}),
|
|
69
|
+
Result = Table.RenameColumns(SelectForOutput, {{"ServicioCodigo", "ServicioId"}}),
|
|
70
|
+
#"Tipo final" = Table.TransformColumnTypes(Result, {{"Data", type text}, {"ServicioId", type text}, {"Servicio", type text}, {"Línea servicio", type text}, {"Modalidad", type text}}, "es-ES")
|
|
71
|
+
in
|
|
72
|
+
#"Tipo final"
|
|
73
|
+
|
|
74
|
+
annotation PBI_ResultType = Table
|
|
75
|
+
|