Forum Discussion
Visual with Slicer and Switch Help Request
- 1 year ago
Hi Anonymous as i understand, please try this,
after defining your measures for example, like this
Invoices Accepted =
CALCULATE (
SUM ( Invoices[Amount ($)] ),
NOT ISBLANK ( Invoices[Submitted Date] ),
NOT ISBLANK ( Invoices[Accepted Date] ),
TREATAS ( VALUES ( Period[ContractYear_ID] ), 'Date'[ContractYear_ID] ),
USERELATIONSHIP ( Invoices[Accepted Date], 'Date'[Date] )
)repeat for submitted, deposited and so on
then create a disconnected table
Category = DATATABLE (
"Category", STRING,
{
{ "Submitted" },
{ "Accepted" },
{ "Deposited" },
{ "Paid" }
}
)and the measure as this Invoice Amount by Category =
SWITCH (
SELECTEDVALUE ( Category[Category] ),
"Submitted", [Invoices Submitted],
"Accepted", [Invoices Accepted],
"Deposited", [Invoices Deposited],
"Paid", [Invoices Paid]
)
Anonymous I would think that you could do something like the following:
SWITCH( [Selected Period ],
1, CALCULATE( [Measure Submitted], 'Invoices'[Period ID] = "Year 1" ),Something along those lines.
Thank you for taking the time Gerald. I updated my Switch as you suggested but feel that I may not have provided enough information. Year 1 is defined in a separate table, therefore the date in the invoices table need to reference back to the date table, grab the ContractYear_ID that way it can be correlated back to the Contract Year, or Period. The invoice table itslef does not identify an invoice as Year 1 etc.
It is very possible that I have completely misunderstood your solution. I did attempt to make it work but was unable to do so.
I have further explained what I am working with thus far and what my end goal is in another post if you are interested in reviewing it and making more suggestions..
Visual with Slicer and Switch Help Request - Microsoft Fabric Community