The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
found a great tutorial on the SQL BI website that shows the differences between the options of using the ALLSELECTED function.
The first table on this page is what I'd like to reproduce in my Power BI Desktop. You can find it here: https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/
I'm using a similar dataset from Microsoft, which is available here: https://github.com/microsoft/powerbi-desktop-samples/blob/main/Sample%20Reports/Sales%20%26%20Return...
I've defined the measures in very similar ways, but the ALLSELECTED function doesn't give me good results.
m_Sales_Amount =
SUMX(
Sales,
Sales[Unit] * Sales[Amount]
)
m_AllSelectedColumn =
CALCULATE(
[m_Sales_Amount],
ALLSELECTED('Customer'[Category])
)
m_AllSelectedTable =
CALCULATE (
[m_Sales_Amount],
ALLSELECTED ( 'Customer' )
)
m_AllSelectedAll =
CALCULATE (
[m_Sales_Amount],
ALLSELECTED ()
)
I'm using the Matrix visual with rows from the Customer table.
Hi @Anonymous ,
Believe that the difference between your example and the one for SQL BI is that they are using values from two different tables:
And in you case the calculations comes from the same table so they have the same result.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsYes, you are right. I found another dataset under another blog post which contains the good one.