Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gururajv007
Helper I
Helper I

Output needed as per Criteria

Dear Expert - Need help from you.

 

I would like to get the Output as per the date & Purpose from Table 1.

 

Criteria 1 : Calculation only for fiscal year Oct'2019 to Sep'2020 ( Current fiscal year )

Criteria 2 : [Actual data] should capture from Oct'19 to Jan20 ie Current month date.

Criteria 3 : If date is > current month, should capture [Plan].

Criteria 4 : If Data is not available in [Plan], then should capture [Forecast]

 

You can refer the Output needed table in the image.

 

Check.png

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi, @Gururajv007 

 

I am sorry for the late reply. Based on your description, I created data to reproduce your scenario.

DateTable:

e1.png

Table:

e2.png

 

Here is the column and measure I created.

 

Rank = RANKX('DateTable',[Date].[Year]*100+[Date].[MonthNo],,ASC,Dense)

OutputValue = 
IF (
    MIN ( 'DateTable'[Date] )
        < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 1, 1 ),
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Actual" ),
    IF (
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Plan" ) = BLANK(),
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Forecast" ),
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Plan" )

    )
)

 

 

Finally, you may use the visual level filter to get the Month-Year you want to display.

e3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Gururajv007 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

Thank you so much for your great help on time.

Gururajv007
Helper I
Helper I

Need some expert advice here..Pl help.

Hi, @Gururajv007 

 

I am sorry for the late reply. Based on your description, I created data to reproduce your scenario.

DateTable:

e1.png

Table:

e2.png

 

Here is the column and measure I created.

 

Rank = RANKX('DateTable',[Date].[Year]*100+[Date].[MonthNo],,ASC,Dense)

OutputValue = 
IF (
    MIN ( 'DateTable'[Date] )
        < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) + 1, 1 ),
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Actual" ),
    IF (
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Plan" ) = BLANK(),
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Forecast" ),
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Purpose] = "Plan" )

    )
)

 

 

Finally, you may use the visual level filter to get the Month-Year you want to display.

e3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-alq-msft
Community Support
Community Support

Hi, @Gururajv007 

 

Could you please show me your sample data? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

Here is the raw data from Excel.

Data.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.