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
Lexey
Helper I
Helper I

the value of the average between the three periods

Hi friends!
There is a fact table with the result of product sales by date. It is necessary to get the average value
between the three periods is selected in the slicers.

I will be glad of any help!

 

Screenshot_9.jpg

https://drive.google.com/open?id=1HShO0E5ueQcIy-MMqxdlmi4DHOcFkz0_

 

1 ACCEPTED SOLUTION

@Lexey

 

Using this model:

 

Img23.png

 

And a Measure Like This:

 

Measure =
VAR TotalTA =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates1'[Date] ); '1'[date] );
        ALL ( '1' )
    )
VAR TotalTB =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates2'[Date] ); '1'[date] );
        ALL ( '1' )
    )
VAR TotalTC =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates3'[Date] ); '1'[date] );
        ALL ( '1' )
    )
RETURN
    DIVIDE ( TotalTA + TotalTB + TotalTC; 3 )

Img24.png

 

Regards

 

Victor




Lima - Peru

View solution in original post

4 REPLIES 4
Vvelarde
Community Champion
Community Champion

@Lexey

 

The only that imagine is duplicate your Fact Table many times of slicers you want.




Lima - Peru

@Lexey

 

Using this model:

 

Img23.png

 

And a Measure Like This:

 

Measure =
VAR TotalTA =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates1'[Date] ); '1'[date] );
        ALL ( '1' )
    )
VAR TotalTB =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates2'[Date] ); '1'[date] );
        ALL ( '1' )
    )
VAR TotalTC =
    CALCULATE (
        SUM ( '1'[sales] );
        TREATAS ( VALUES ( 'Dates3'[Date] ); '1'[date] );
        ALL ( '1' )
    )
RETURN
    DIVIDE ( TotalTA + TotalTB + TotalTC; 3 )

Img24.png

 

Regards

 

Victor




Lima - Peru

super! Thank you! Now I'm one step closer to the solution!

Only I need an average for each product, I'll try to find a solution)Screenshot_1.jpg

Lexey
Helper I
Helper I

really? no solution to find the average for each product?

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.