- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Tratar de crear una medida de varianza TYD con variables y no obtener un resultado
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Ive got it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hola @DebbieE ,
En DAX, las variables se calculan dentro del ámbito en el que se escriben y, a continuación, el resultado de ellas se almacena y se utiliza en el resto de la expresión. Consulte más información: Precaución al usar variables en DAX y Power BI.
Puede cambiar la fórmula como DAX a continuación.
YTD Sales Var =
VAR TYTD = TOTALYTD(SUM(Table1[Sales]), DimDate[FullDateAlternateKey])
VAR LYTD = CALCULATE(SUM(Table1[Sales]) ,SAMEPERIODLASTYEAR(DimDate[FullDateAlternateKey]))
RETURN TYTD-LYTD
Como referencia:
https://community.powerbi.com/t5/Desktop/var-different-result/td-p/283143
https://community.powerbi.com/t5/Desktop/VAR-different-result-than-without-it/td-p/518723
Saludos
Amy
Equipo de apoyo a la comunidad _ Amy
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

VAR LYTD = CALCULATE (SUM (Table1 [Sales]), SAMEPERIODLASTYEAR (DimDate [FullDateAlternateKey]))
But this isnt calculating the Year to date measure that Im basing last year on so this wouldnt work?
As in my TYTD variable
TOTALYTD (SELECTEDMEASURE (), DimDate [FullDateAlternateKey])
I should say, Im trying to do some work on calulated groups with Tabular Editor and Im trying to find ways of recreating my measures so they could be used for calculated groups and its proving really difficult
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Ive got it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@DebbieE - Esto le puede resultar útil - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
También, ver si mi Inteligencia del Tiempo el Camino Duro proporciona una manera diferente de lograr lo que está buscando.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!: Power BI Cookbook Third Edition (Color)
DAX is easy, CALCULATE makes DAX hard...

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
07-18-2024 01:28 PM | |||
01-17-2024 08:31 AM | |||
10-05-2023 02:12 PM | |||
04-29-2024 01:46 AM | |||
08-19-2023 05:18 PM |