Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

dax related

i want to create new table with only region and description as visual in power but it has to show last month values based on fiscal month slicer selection how to achieve in power bi

  • Hi Anonymous - You can use DAX to create a calculated table that filters data for the last month based on the fiscal month selected from the slicer. Assuming you have a table with region, description, and values (e.g., SalesData), here’s how you can do it:

    Steps:
    Go to the Modeling tab in Power BI and choose New Table.
    Write a DAX formula to create the new table based on your fiscal month and last month data.

     

    filter for last month’s data using calculated table:

     

    LastMonthData =
    VAR SelectedFiscalMonth = MAX('Date'[FiscalMonth])  -- Get the selected fiscal month
    VAR LastMonth = SelectedFiscalMonth - 1               -- Calculate the previous month
    RETURN
    FILTER(
        financials,
        'financials'[Date] = LastMonth                -- Filter data for the last month
    )

     

     

    This creates a table that will show only the data for the last month based on the selected fiscal month in your slicer.

1 Reply

  • Hi Anonymous - You can use DAX to create a calculated table that filters data for the last month based on the fiscal month selected from the slicer. Assuming you have a table with region, description, and values (e.g., SalesData), here’s how you can do it:

    Steps:
    Go to the Modeling tab in Power BI and choose New Table.
    Write a DAX formula to create the new table based on your fiscal month and last month data.

     

    filter for last month’s data using calculated table:

     

    LastMonthData =
    VAR SelectedFiscalMonth = MAX('Date'[FiscalMonth])  -- Get the selected fiscal month
    VAR LastMonth = SelectedFiscalMonth - 1               -- Calculate the previous month
    RETURN
    FILTER(
        financials,
        'financials'[Date] = LastMonth                -- Filter data for the last month
    )

     

     

    This creates a table that will show only the data for the last month based on the selected fiscal month in your slicer.