Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
I have a dashboard with 2 visuals : one Table and one Card.
The table displays the content of "Query A".
In that query A, I have added a Measure :
NbNumberInDoubloon = COUNTROWS('Query A')
It works OK, except when lines are selected in the Table visual, the Card changes its display. It recalculates according to the lines selected and not anymore to the whole content of "Query A".
If it matters, this measure is added within the query, not in a separate query/table that would contain only the measures (I think it is possible that's why I say that).
The code of my measure refers to "Query A" in its globality, so why does it change when lines are selected ? Why are they linked ? And how can I make sure it displays all the time the number of rows of the whole table ?
Thanks for your help,
Solved! Go to Solution.
Hi @Anonymous ,
This calculation altough refers to the total table is based on the values of the selection meaning that any filters will impact this calculation making a selection of lines in a table is applying a filter to the card.
If this metric is only used on this card and you don't want it to change no matter what filters you apply rewrite to:
NbNumberInDoubloon = COUNTROWS(ALL('Query A'))
If you want the metric to have impact of the filters expect when you select other visualizations then you must turn off the interaction between the table and the card:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Anonymous ,
This calculation altough refers to the total table is based on the values of the selection meaning that any filters will impact this calculation making a selection of lines in a table is applying a filter to the card.
If this metric is only used on this card and you don't want it to change no matter what filters you apply rewrite to:
NbNumberInDoubloon = COUNTROWS(ALL('Query A'))
If you want the metric to have impact of the filters expect when you select other visualizations then you must turn off the interaction between the table and the card:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt works indeed, thank you.
I thought I could apply the same on my other measure that behaves the same :
NbDisctinctNumberInDoubloon = DISTINCTCOUNT('Query A'[phone number])
But whether I use
NbDisctinctNumberInDoubloon = DISTINCTCOUNT(ALL('Query A')[phone number])
or
NbDisctinctNumberInDoubloon = DISTINCTCOUNT(ALL('Query A'[phone number]))
It gives me error. It doesn't work on the same base ?
Hi @Anonymous
Bing a distinct count you need to use a different context:
NbDisctinctNumberInDoubloon = CALCULATE(DISTINCTCOUNT('Query A'[phone number]),ALL('Query A'[phone number]) )
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt's aint working either 😞 When I select 1 line, the value displayed is 1)
Actually, it is just a typo from you I guess, you left the column name in the second argument.
It works fine like this :
NbDisctinctNumberInDoubloon = CALCULATE(DISTINCTCOUNT('Query A'[phone number]),ALL('Query A'))
I am surprised though that it didn't raise an error with the column name on it.
Hi @Anonymous,
The ALL function also works with columns however once again the context is important so if you are using columns from the query a on your table the result can be influenced
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsStarting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |