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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Quick Measures not working in table visual

Hi,

 

I am testing quick measures for running totals. There is an issue, when I use the running total in a table visual, so that it doesn'n sum at all.

 

test table:


Index Date                          Type  Value

101.01.2019 00:00:00A100
203.01.2019 00:00:00B200
307.01.2019 00:00:00A300
402.02.2019 00:00:00B1040
502.02.2019 00:00:00B350
615.02.2019 00:00:00B230
705.03.2020 00:00:00A550

 

When I put all those columns into a table visual and add the quick measure running total:

 

Running Total =
CALCULATE(
    SUM('FactsTable'[Value]);
    FILTER(
        ALLSELECTED('FactsTable'[Index]);
        ISONORAFTER('FactsTable'[Index]; MAX('FactsTable'[Index]); DESC)
    )
)
 
the result is:
 
result1.PNG
 
When I put that measur into a matrix, it works.
 
I think it is because of the ALLSELECTED function. When I put ALLSELECTED('FactsTable') instead of ALLSELECTED('FactsTable'[Index]) it works in the table visual.
 
Can someone explain this behavior?
 
thx
 
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

This relates to the row context and filter context in DAX,

https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/

https://docs.microsoft.com/en-us/dax/allselected-function-dax

If you use this measure

Running Total =
CALCULATE(
    SUM('FactsTable'[Value]);
    FILTER(
        ALLSELECTED('FactsTable'[Index]);
        ISONORAFTER('FactsTable'[Index]; MAX('FactsTable'[Index]); DESC)
    )
)
It only removes context filters for Index column.
Now the visual should only incude Index attribute column. If there are other attribute column, it needs same.
For example
4.JPG
3.JPG
In your case, for the same date and type, it will work.
 
So you need put ALLSELECTED('FactsTable') instead of ALLSELECTED('FactsTable'[Index]).
 

Best Regards,

Lin

Community Support Team _ Lin
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

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

This relates to the row context and filter context in DAX,

https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/

https://docs.microsoft.com/en-us/dax/allselected-function-dax

If you use this measure

Running Total =
CALCULATE(
    SUM('FactsTable'[Value]);
    FILTER(
        ALLSELECTED('FactsTable'[Index]);
        ISONORAFTER('FactsTable'[Index]; MAX('FactsTable'[Index]); DESC)
    )
)
It only removes context filters for Index column.
Now the visual should only incude Index attribute column. If there are other attribute column, it needs same.
For example
4.JPG
3.JPG
In your case, for the same date and type, it will work.
 
So you need put ALLSELECTED('FactsTable') instead of ALLSELECTED('FactsTable'[Index]).
 

Best Regards,

Lin

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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