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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CesarF_mx
Advocate I
Advocate I

Can Power BI create summarization tables from virtual tables?

1) I loaded a normalized table from SqlServer: KVH

With 9 columns: Date, Key0, Key1, Key2, Key3, Key4, Key5, Key6, Value

 

2) I created a virtual table KVH_vmxg

	KVH.vmxg =
	    SELECTCOLUMNS(
		SUMMARIZE(
		    FILTER(
			ALL(KVH),
			KVH[Key0] in { "VntMesImpGdLDZV", "VntMesPzsGdLDZV" }
			), 
		    KVH[Date],
		    KVH[Key1],
		    KVH[Key2],
		    KVH[Key3],
		    KVH[Key4],
		    "Year",     YEAR( KVH[Date] ),
		    "AcmSls",   ROUND( COALESCE( 
                                       CALCULATE(SUM(KVH[ValKpi]), 
                                                 KVH[AbvKpi] = "VntMesImpGdLDZV"), 0 ), 2 ),
		    "AcmQty",   ROUND( COALESCE( 
                                       CALCULATE(SUM(KVH[ValKpi]), 
                                                 KVH[AbvKpi] = "VntMesPzsGdLDZV"), 0 ), 0 )
		    ),
		"KPI Date",		[Date],
		"Year",			[Year],
		"Quarter",		"Q" & FORMAT( [Date], "\Qq" ),
		"MonthNum",		MONTH([Date]),
		"Month",		FORMAT( [Date], "MMMM" ),
		"Line",			[Key1],
		"Country",      	[Key2],
		"Zone",         	[Key3],
		"Salesman",     	[Key4],
		"Sales",		[AcmSls],
		"Quantity",		[AcmQty]
		)

 

3) Now I need to sumarize KVH_vmxg virtual table by Year

	CMP.vaaitaccmp = 

	ADDCOLUMNS(
	    SUMMARIZE(
		KVH.vmxg,
		[Year]		// The syntax for [Year] is incorrect
	    ),
	    "Total Ventas", 
		CALCULATE(
		    SUMX(
			FILTER(KVH.vmxg, 
			    [Year] = KVH.vmxg[Year]
			), 
			KVH.vmxg[Sales]
		    )
		),
	    "Last Year Sales", 
		CALCULATE(
		    SUMX(
			FILTER(KVH.vmxg, 
			    [Year] = KVH.vmxg[Year] - 1
			), 
			KVH.vmxg[Sales]
		    )
		)
	)

 

4) Even with ChatGTP, I still getting syntax error.
Can PowerBI create summarization tables from virtual tables?


 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

A virtual table lives inside a definition for a measure (mostly) . Your KVH.vmxg seems to be a regular calculated table.

 

Other than that, yes.

View solution in original post

2 REPLIES 2
CesarF_mx
Advocate I
Advocate I

btw Ibendilin, thank you for your clarification about table nomenclature.

lbendlin
Super User
Super User

A virtual table lives inside a definition for a measure (mostly) . Your KVH.vmxg seems to be a regular calculated table.

 

Other than that, yes.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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