Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.