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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Create SUMMARIZE Table with Quarters

Hi folks.

 

I would like to build a Temp Table that I want to further use on some measures. It would be easy to create this table on the report layout, if I wanted just the visualization, but I want the Table itself and I am having a hard time.

 

There are two FACT tables and two DIM tables (let's call them FACT1, FACT2, DIM1, DIM2).

 

Untitled.png

 

 

 

 

 

 

 

 

 

 

 

 

I want to SUMMARIZE the Table FACT1 by ID1, ID2 and Quarter (Qtr X YYYY), adding a calculated column from a Measure on FACT2.

 

The Measure is:

 

SO UNITS = SUM('FACT2'[UNID])

SO UNITS PYG % =
VAR __PREV_YEAR =
    CALCULATE ( [SO UNITS]; DATEADD ( 'Calendar'[Date].[Date]; -1; YEAR ) )
RETURN
    DIVIDE ( [SO UNITS] - __PREV_YEAR; IF ( __PREV_YEAR = 0; 1; __PREV_YEAR ) )

 

 To create the table, I did something like this:

 

TEMP TABLE = 
VAR TTABLE =
    ADDCOLUMNS (
        'FACT1';
        "QUARTERFACT";
        CONCATENATE("Qtr ";CONCATENATE(ROUNDUP(MONTH('FACT1'[Data])/3;0);CONCATENATE(" ";FORMAT('FACT1'[Data];"YYYY"))))
        )
RETURN
        SUMMARIZE (
            TTABLE;
            'FACT1'[ID1];
            'FACT1'[ID2];
            [QUARTERFACT];
            "tempmeasure"; [SO UNITS PYG %]
        )

 

Looking at the result, this is obviously very wrong.

 

Untitled.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What am I missing here? I am lost in context here, I think. I have tried messing around with it but no luck so far.

 

Thanks in advance.

 

Cheers.

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

I test with your data model and formula on my site, but I can get the result i want.

I don't know what your expected result and what's wrong of the last screenshot.

Could you point out these?

 

Best Regards

Maggie

Anonymous
Not applicable

@v-juanli-msft

 

I could send you a sample file, but I have stepped upon the issue that I will explain below several times...

 

How can I sample data and remove the queries from the PBIX file so that it's smaller, addresses privacy and still you can test it? It's a 70MB file (huge tables) with several data sources.

 

Is there a fast way of doing this or should I just change the queries one by one?

 

Thanks.

Hi @Anonymous

You could make a copy of your pbix, then go to Query Editor, use "keep rows","keep columns" or "remove rows" to keep the data which can explain your problem.

Due to privacy, you can send me a message. 

 

Best Regards

Maggie

Anonymous
Not applicable

I will send you a private message.

 

Thanks a lot.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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