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]
)
Use your custom ContractYear_ID instead of TOTALYTD/MTD.
Example:
SelectedContractYearID =
SELECTEDVALUE('Period'[ContractYear_ID])
Period Submitted =
VAR SelPeriod = [SelectedContractYearID]
RETURN
CALCULATE(
[Measure Submitted],
KEEPFILTERS(
FILTER('Date', 'Date'[ContractYear_ID] = SelPeriod)
)
)
👉 This way the slicer drives which contract year is applied, instead of fixed calendar functions.
Forgive me for being so inexperienced. I tried your solultion by creating a measure against my period table for "SelectedContractYearID" as you indicated above. I then created a measure for Period Submitted as you indicated in your comment. Unfortunately this does not work in my scenario. I have updated my post with the "Submitted Measure" in hopes that you (or someone) can help. I am afraid after looking at the responses that the fault is mine for not including enough information. I have also created a bigger post to elaborating more on what my end goal is if you are interested.
Visual with Slicer and Switch Help Request - Microsoft Fabric Community