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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
calonzo2078
Frequent Visitor

Quiero enviar multiples valores a un filtro a traves de un parametro en DAX

Hola Amigos 

 

Tengo este query en DAX que me trae una tabla con los valores esperados con base a 3 filtros fundamentales 

 

Compania = "American Plains Coop - Kansas"

Para los meses de = October, november , december

Del ano 2022.

 

Les muestro el codigo de la consulta:

 

// DAX Query
DEFINE
VAR __DS0FilterTable =
TREATAS({"American Plains Coop - Kansas"}, 'company'[company_name])

 

VAR __DS0FilterTable2 =
FILTER(
KEEPFILTERS(VALUES('DDate'[year])),
AND('DDate'[year] IN {2022}, 'DDate'[year] IN {2022})
)

 

VAR __DS0FilterTable3 =
TREATAS({"November",
"October",
"December"}, 'DDate'[month])

 

VAR __DS0FilterTable4 =
TREATAS({"Agronomic"}, 'machine'[machine_type])

 

VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('machine'[last_machine_name], "IsGrandTotalRowTotal"),
__DS0FilterTable,
__DS0FilterTable2,
__DS0FilterTable3,
__DS0FilterTable4,
"mea_act_engine_hr_spray", 'metrics'[mea_act_engine_hr_spray]
)

 

VAR __DS0PrimaryWindowed =
TOPN(
502,
__DS0Core,
[IsGrandTotalRowTotal],
0,
[mea_act_engine_hr_spray],
0,
'machine'[last_machine_name],
1
)

 

EVALUATE
__DS0PrimaryWindowed

ORDER BY
[IsGrandTotalRowTotal] DESC,
[mea_act_engine_hr_spray] DESC,
'machine'[last_machine_name]

 

Mi problema es que para la variable de ano

 

VAR __DS0FilterTable3 =
TREATAS({"November",
"October",
"December"}, 'DDate'[month])

 

Siempre me va a traer la informacion de esos meses en particular, y quiero saber como podria ser el codigo para que esos valores lleguen al query a traves de un parametro que me acepte multiple valores llamado @month

 

Para que asi, si selecciono ene, feb y marzo, me traiga la info de esos meses ... o si selecciono solo jun y jul la consulta se adapte a esos nuevos valores 

 

Mil gracias de antemano 

1 REPLY 1
calonzo2078
Frequent Visitor

 me equivoque ... l avariable con el problema no es "ano" es "mes" 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors