Forum Discussion
GalaBI79
1 year agoRegular Visitor
Slicer selection not working in virtual table creation
Hi all, First of all, apologies for my english, but it's not my first language 😁 I'm new to Power BI so sorry for any mistakes. I have a table with invoices, organized by invoice date. I...
- Anonymous1 year ago
Hi GalaBI79 ,
I made a sample for you.
Measure = var _column = MAX('Table3'[Column1]) var _value= SWITCH(TRUE(), _column="Today"&&HASONEVALUE('Calendar'[Date]),CALCULATE([InvoiceValue],'Invoice'[InvoiceDate]=SELECTEDVALUE('Calendar'[Date])), _column="Month"&&HASONEVALUE('Calendar'[Date]),CALCULATE([InvoiceValue],FORMAT('Invoice'[InvoiceDate],"MMMM")=SELECTEDVALUE('Calendar'[Date].[Month])), _column="Month To Date"&&HASONEVALUE('Calendar'[Date]),CALCULATE([InvoiceValue],Month('Invoice'[InvoiceDate])<=MONTH(SELECTEDVALUE('Calendar'[Date]))), _column="Today"&&HASONEVALUE('Calendar'[Date].[Month]),CALCULATE([InvoiceValue],'Invoice'[InvoiceDate]=MAX('Calendar'[Date])), _column="Month"&&HASONEVALUE('Calendar'[Date].[Month]),CALCULATE([InvoiceValue],FORMAT('Invoice'[InvoiceDate],"MMMM")=SELECTEDVALUE('Calendar'[Date].[Month])), _column="Month To Date"&&HASONEVALUE('Calendar'[Date].[Month]),CALCULATE([InvoiceValue],Month('Invoice'[InvoiceDate])<=MONTH(MIN('Calendar'[Date]))) ) RETURN _valueNote: This measure only considers the month and does not consider the year as a filter condition.
Best Regards,
Wearsky
HotChilli
Community Champion
1 year agoTB_Fatture_All is not a virtual table, it is a table. Tables and calculated columns are not affected by slicers. They are created at 'refresh' time. Slicers affect visuals.
It is not a good idea to use measures to create calculated columns or tables.